public void GetAgeReturnsCorrectValue_MoreExpressive_Test()
        {
            // Arrange
            Employee emp = new EmployeeBuilder().WithBirthDate(new DateTime(1983, 1, 1));
            // Act
            int age = emp.getAge();

            // Assert
            Assert.That(age, Is.EqualTo(DateTime.Today.Year - 1983));
        }
예제 #2
0
        public void GetAgeReturnsCorrectValueFulentBuilder()
        {
            // Arrange
            Employee emp = new EmployeeBuilder().WithBirthDate(new DateTime(1983, 1, 1));

            // Act
            int age = emp.getAge();

            // Assert
            Assert.AreEqual(age, DateTime.Today.Year - 1983);
        }