Exemplo n.º 1
0
        public static IEnumerable <object[]> DiscountedProductsGetHalfPrice()
        {
            var products = new List <IProductLineItem> {
                TestMockProductsLineItems.ButterItem(), TestMockProductsLineItems.ButterItem(), TestMockProductsLineItems.BreadItem(), TestMockProductsLineItems.BreadItem()
            };
            var products2 = new List <IProductLineItem> {
                TestMockProductsLineItems.ButterItem(), TestMockProductsLineItems.ButterItem(), TestMockProductsLineItems.ButterItem(), TestMockProductsLineItems.ButterItem(),
                TestMockProductsLineItems.BreadItem(), TestMockProductsLineItems.BreadItem()
            };
            var products3 = new List <IProductLineItem> {
                TestMockProductsLineItems.ButterItem(), TestMockProductsLineItems.ButterItem(), TestMockProductsLineItems.ButterItem(), TestMockProductsLineItems.ButterItem(),
                TestMockProductsLineItems.BreadItem(), TestMockProductsLineItems.BreadItem(), TestMockProductsLineItems.BreadItem()
            };

            yield return(new object[] { products, 3.10m });

            yield return(new object[] { products2, 4.20m });

            yield return(new object[] { products3, 5.20m });
        }
Exemplo n.º 2
0
        public static IEnumerable <object[]> Products()
        {
            var products = new List <Product> {
                TestMockProductsLineItems.BreadItem().Product
            };
            var products2 = new List <Product> {
                TestMockProductsLineItems.BreadItem().Product, TestMockProductsLineItems.BreadItem().Product
            };
            var products3 = new List <Product> {
                TestMockProductsLineItems.BreadItem().Product, TestMockProductsLineItems.ButterItem().Product, TestMockProductsLineItems.MilkItem().Product
            };
            var products4 = new List <Product> {
                TestMockProductsLineItems.BreadItem().Product, TestMockProductsLineItems.ButterItem().Product, TestMockProductsLineItems.MilkItem().Product, TestMockProductsLineItems.MilkItem().Product
            };

            yield return(new object[] { products, 1, 1.00m });

            yield return(new object[] { products2, 1, 2.00m }); // Line items should still be 1 but total 2

            yield return(new object[] { products3, 3, 2.95m });

            yield return(new object[] { products4, 3, 4.10m });
        }