Hello, I am relatively new to using TDD and have been reading about mocking objects lately. I have the following test to test a method that given a date returns the next saturday.
[TestMethod()]
public void NextSaturdayTest()
{
DateTime date = new DateTime();
date = DateTime.Parse("2010-08-14");
DateTime expected = new DateTime();
expected = DateTime.Parse("2010-08-21");
DateTime actual;
actual = DateExtensions.NextSaturday(date);
Assert.AreEqual(expected, actual);
date = DateTime.Parse("2010-08-19");
expected = DateTime.Parse("2010-08-21");
actual = DateExtensions.NextSaturday(date);
Assert.AreEqual(expected, actual);
}
first off, does this represent good testing practices? Second, what is the advantage of utilizing a mock framework to create this test?
Let me know if I can offer any more information.
Thanks for any thoughts