I had a problem (page 190) following along after creating the LoadTests database and adding the method.
public void CurrentStatusDataTest()
var target = new Subscription();
var date = this.TestContext.DataRow["PaidUp"] as DateTime?;
var val = Enum.Parse(typeof(Subscription.Status),
this.TestContext.DataRow["Status"] as string);
Assert.AreEqual(val, target.CurrentStatus, "Subscription.CurrentStatus was not set correctly.");
There was no recognition of the TestContext. The book did not seem to mention where to put the TestContext object suggesting that it was automatically generated. After looking at the downloadable code and seeing the field and property declared in the SubscriptionTest class
///Gets or sets the test context which provides
///information about and functionality for the current test run.
public TestContext TestContext
testContextInstance = value;
I was wondering if the book was negligent in mentioning what TestContext is, how it works, and when it should be inserted. Also a more expansive detail on how it relates to the DataSource property (step 3, page 189) would be helpful.