First of, created the following test case...
[TestMethod]
public void canGetListofClassesFromCodeFile()
{ CodeManager cm = new CodeManager();
string[] classnames = cm.GetClassNamesFromFile();
Assert.IsTrue(classnames.Count() > 0);
}
What I did here was write the test the way I wanted it to work. This is a little difficult because design and implementation keep flying around in my head. I suppressed the urge to design and possibly over-design and went with adding a user story/functionality to the code.
The first time the test would not compile, so I implemented the GetClassNamesFromFile() with no code in the method. The code compiles but throws a NotImplementedException. We will return a List<string> with one element.
The test case passed, and I am returned a List<string> instead, with a classname that I added. Once again I am faced with an incorrect implementation and I wonder do I add another test to fix it, or do I modify the code now.
Q. What happens when one test breaks another test?
A. [I have not been able to answer this. Feel free to post an answer in the comments]
Now attempting, to implement reading in the code file. My unit test is failing, so I am incrementally fixing it.
My code feels very messy at the moment. I will post up more later.