示例#1
0
        private static Product GetExistingProduct(int Id)
        {
            var productCategories = MockFactory.GetProductCategories(true);

            IEnumerable <Product> products = MockFactory.GetProducts(true, productCategories);

            return(products.Where(p => p.Id == Id).First());
        }
示例#2
0
        private static Order GetOrder(int Id)
        {
            var products = MockFactory.GetProducts(true, MockFactory.GetProductCategories(true));

            var order = CreateOrder(products);

            order.Id = Id;

            // Update the orderline id's with test values
            order.OrderLines = order.OrderLines.Select((ol, i) => { ol.Id = (i + 1) * 2 - 1;  return(ol); }).ToList();

            return(order);
        }
示例#3
0
        public static OrderLine GetExistingOrderLine(int Id)
        {
            var products = MockFactory.GetProducts(true, MockFactory.GetProductCategories(true));

            return(CreateOrderLine(products, Id, Constants.PRODUCT_ID_FOUND, 1, 1));
        }
示例#4
0
 private static IEnumerable <ProductCategory> GetProductCategories()
 {
     return(MockFactory.GetProductCategories(true));
 }
示例#5
0
        private static IEnumerable <Product> GetProducts()
        {
            var productCategories = MockFactory.GetProductCategories(true);

            return(MockFactory.GetProducts(true, productCategories));
        }