Exemplo n.º 1
0
        [Test]  // Ensures that property setters in the code point to the correct property
        public void Test_PropertySettersUseCorrectPropertyNames()
        {
            CheckIfTestShouldBeIgnored();
            //---------------Set up test pack-------------------
            var driver = new Driver();
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            object valueForDriverName = TestUtilsShared.GetRandomString();            
            driver.SetPropertyValue("DriverName", valueForDriverName);
            object valueForAge = TestUtilsShared.GetRandomInt();            
            driver.SetPropertyValue("Age", valueForAge);
            object valueForDOB = TestUtilsShared.GetRandomDate();            
            driver.SetPropertyValue("DOB", valueForDOB);
            object valueForLicenseRaing = (double)TestUtilsShared.GetRandomInt();            
            driver.SetPropertyValue("LicenseRaing", valueForLicenseRaing);
            
            //---------------Test Result -----------------------
            Assert.AreEqual(valueForDriverName, driver.DriverName);
            Assert.AreEqual(valueForAge, driver.Age);
            Assert.AreEqual(valueForDOB, driver.DOB);
            Assert.AreEqual(valueForLicenseRaing, driver.LicenseRaing);
        }