Exemplo n.º 1
0
        public virtual Order PlaceOrder()
        {
            Guard.Hope(!string.IsNullOrWhiteSpace(DeliveryAddress), "Deliver address is not set");

            var order = new Order(_basketItems, DeliveryAddress);
            _basketItems.Clear();
            return order;
        }
Exemplo n.º 2
0
 protected override void PersistenceContext()
 {
     _product = new ProductBuilder().Build();
     var customer = new CustomerBuilder()
         .WithProductInBasket(_product, ProductQuantity)
         .WithDeliveryAddress()
         .Build();
     _order = new OrderBuilder()
         .WithCustomer(customer)
         .Build();
     Save(_product, _order);
 }
Exemplo n.º 3
0
 protected override void PersistenceQuery()
 {
     _retrievedOrder = Get<Order>(_order.Id);
 }