Example #1
0
        public void WrongEndDateTestIsValid()
        {
            // Arrange
            ProductNames.Product product = new ProductNames.Product();
            product.EndDate = new System.DateTime(2008, 3, 5);
            //ACT
            bool test3 = product.IsValid();

            //Assert
            Assert.AreNotEqual(true, test3, "The program should return false but it returns true, the current time can be greater than the end time");
        }
Example #2
0
        public void CorectTestIsValid()
        {
            // Arrange
            ProductNames.Product product = new ProductNames.Product();
            product.StartDate = new System.DateTime(2007, 5, 2);
            product.EndDate   = new System.DateTime(2019, 3, 5);
            //ACT
            bool test1 = product.IsValid();

            //Assert
            Assert.AreNotEqual(false, test1, "The program should return true but it returns false");
        }
Example #3
0
        public void WrongStartDateTestIsValid()
        {
            // Arrange
            ProductNames.Product product = new ProductNames.Product();
            product.StartDate = new System.DateTime(2020, 5, 2);
            product.EndDate   = new System.DateTime(2019, 3, 5);
            //ACT
            bool test2 = product.IsValid();

            //Assert
            Assert.AreNotEqual(true, test2, "The program should return false but it returns true, the start date can be greater than the end date");
        }
Example #4
0
        public void TestComputeVAT()
        {
            //Arrange
            ProductNames.Product product = new ProductNames.Product();
            product.Price = 15.5;
            product.VAT   = 25;
            double expected = 19.375;
            //Act
            double actual = product.ComputeVAT();

            //Assert
            Assert.AreEqual(expected, actual, "The ComputeVat returns a wrong calculation");
        }