public void ApproxYobFromAgeTest() { SystemTime.NowFunction = () => new DateTime(2010, 6, 11, 10, 15, 16, 178); // Null age var expected = (int?)null; var actual = DateTimeExtensions.ApproxYobFromAge(null); Assert.IsNull(actual); // Negative age expected = null; actual = DateTimeExtensions.ApproxAgeFromYob(-1); Assert.IsNull(actual); // Future yob expected = null; actual = DateTimeExtensions.ApproxAgeFromYob(2011); Assert.IsNull(actual); // Zero age expected = 0; actual = DateTimeExtensions.ApproxAgeFromYob(2010); Assert.AreEqual(expected, actual); // Future yob expected = 3; actual = DateTimeExtensions.ApproxAgeFromYob(2007); Assert.AreEqual(expected, actual); }