コード例 #1
0
        public void ProductListIndex_IsReturned_WhenDefaultConstructorIsUsed()
        {
            //Arrange
            OrderFunctionality o3       = new OrderFunctionality();
            Product            product3 = new Product();

            o3.NewProduct(product3);

            //Act
            //Assert
            Assert.AreEqual(o3.ProductInformation("P0000"), 0);
        }
コード例 #2
0
        public void Index_IsNotReturned_WhenProductNotInList()
        {
            //Arrange
            OrderFunctionality o2       = new OrderFunctionality();
            Product            product2 = new Product("1", "Test2", 0.01m);

            o2.NewProduct(product2);

            //Act
            //Assert
            Assert.AreNotEqual(o2.ProductInformation("2"), 0);
        }
コード例 #3
0
        public void Index_IsReturned_WhenProductAdded()
        {
            //Arrange
            OrderFunctionality o1       = new OrderFunctionality();
            Product            product1 = new Product("1", "Test1", 0.01m);

            o1.NewProduct(product1);

            //Act
            //Assert
            Assert.AreEqual(o1.ProductInformation("1"), 0);
        }
コード例 #4
0
        public void OrderTotalIsZero_IsReturned_WhenQuantityIsZero()
        {
            //Arrange
            OrderFunctionality o8  = new OrderFunctionality();
            OrderDetails       od1 = new OrderDetails("REF-000-000-01", "REF-000-001", "P0001", 0);

            o8.NewOrderDetails(od1);
            Product product1 = new Product("1", "Test1", 0.01m);

            o8.NewProduct(product1);
            //Act
            //Assert
            Assert.AreEqual(o8.OrderTotal("REF-000-000-01", "1"), 0.00m);
        }