Esempio n. 1
0
 public OrderItem CreateItem(Order order, Product product)
 {
     return new OrderItem
     {
         Order = order,
         Price = 1,
         Product = product,
         Quantity = 3,
         Store = "Internet"
     };
 }
Esempio n. 2
0
 public Product CreateProduct()
 {
     var product = new Product
     {
         Name = "Product" + RandomString(),
         Description = "Product Description" + RandomString()
     };
     _generator.Session.Save(product);
     _generator.EntitiesPersisted.Add(product);
     return product;
 }
Esempio n. 3
0
 public Product[] CreateProducts(int count)
 {
     var products = new Product[count];
     for (var i = 0; i < count; i++)
         products[i] = CreateProduct();
     return products;
 }
Esempio n. 4
0
 public Order CreateOrderForProducts(Product[] products)
 {
     var order = CreateOrderForCustomer(CreateCustomer());
     foreach (var product in products)
         order.Items.Add(CreateItem(order, product));
     return order;
 }