Package com.vtence.tape.testmodel

Examples of com.vtence.tape.testmodel.Order


    public OrderRecord(Table<? extends PaymentMethod> payments) {
        this.payments = payments;
    }

    public Order hydrate(ResultSet rs) throws SQLException {
        Order order = new Order(new OrderNumber(number.get(rs)));
        if (payment.get(rs) != Types.NULL)
            order.paidUsing(payments.hydrate(rs));
        idOf(order).set(id.get(rs));
        return order;
    }
View Full Code Here


        assertThat("selection", selection, everyItem(orderWithNumber(startsWith("1000"))));
    }

    @SuppressWarnings("unchecked") @Test public void
    orderingExtractedRecords() throws Exception {
        Order order = persist(anOrder().containing(
                anItem().withNumber("00000001"),
                anItem().withNumber("00000002"),
                anItem().withNumber("00000003")));
        for (LineItem lineItem : order.getLineItems()) {
            orderOf(lineItem).set(order);
            persist(lineItem);
        }

        List<LineItem> selection = Select.from(lineItems).
View Full Code Here

        this.paymentMethod = paymentMethod;
        return this;
    }

    public Order build() {
        Order order = new Order(orderNumber);
        for (Item item : items) {
            order.addItem(item);
        }
        order.paidUsing(paymentMethod);
        return order;
    }
View Full Code Here

TOP

Related Classes of com.vtence.tape.testmodel.Order

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.