Esempio n. 1
0
        private OrderDto CreateOrderDto()
        {
            var     id        = IdFactory.Next();
            decimal unitPrice = id + 0.99m;
            var     order     = new OrderDto
            {
                Customer            = (CustomerIdentifier)_customer,
                Store               = (StoreIdentifier)_store,
                ShippingAddress     = $"{id} Main Street",
                ShippingCity        = $"{id}ville",
                ShippingProvince    = $"Distinct {id}",
                ShippingCountry     = $"{id}land",
                ShippingPostalCode  = $"zip{id}",
                CustomerPhoneNumber = $"({id}) {id}-{id}",
                TotalPrice          = 3 * unitPrice,
                LineItems           = new List <OrderLineItemDto>()
                {
                    new OrderLineItemDto {
                        Product    = (ProductIdentifier)_product,
                        UnitPrice  = unitPrice,
                        Quantity   = 2,
                        TotalPrice = 2 * unitPrice
                    }
                }
            };

            return(order);
        }