, , . , - (, DateProvider - ), DateTime .
I would, however, clear your test. You should stick to testing one thing for each method, because if this testing method fails, you will find out WHY it failed, instead of checking the statements and wondering if the rest of them passed.
[TestMethod()]
public void NextSaturdayReturnsCorrectValueStartingFromASaturday()
{
DateTime date = DateTime.Parse("2010-08-14");
DateTime expected = DateTime.Parse("2010-08-21");
DateTime actual = DateExtensions.NextSaturday(date);
Assert.AreEqual(expected, actual);
}
[TestMethod()]
public void NextSaturdayReturnsCorrectValueWithinTheSameWeek()
{
DateTime date = DateTime.Parse("2010-08-19");
DateTime expected = DateTime.Parse("2010-08-21");
DateTime actual = DateExtensions.NextSaturday(date);
Assert.AreEqual(expected, actual);
}
And, as others have suggested, continue to expand your test class to include checks on some stranger situations you might encounter.
source
share