Wow this gets complicated fast. I am still have trouble what kind of tests I should write. I am attempting to write a code Indexer with Search capabilities. Here is the list of Test Cases so far:
- CodeManagerCanCreateInstanceOfFileManager
- CodeManagerReturnsEmptyListWhenSearchTermNotProvided
- CanGetAListOfFilesFromDirectory
- CanGetListOfOnlyCodeFiles
CreateCodeFileObject
The main problem I have is trying to figure out how to move to the next test. The code is evolving and I feel confident after I make changes. The code generation feels off. I have created a Test List. Some of the items I am currently researching include What goes in a Test Lest ? Does it map to a Use Case? Something the developer does?
Let me give an example of this one. I am creating a test then I see a need for the FileManager object. Do I then create a Test that makes me create the File Manager Object , or do I just create another test and implement the File Manager Class as a by product of that Test?
Right now the Code has evolved to include the following objects : (CodeFile,FileManager,CodeManager) using SoC(Separation of Concerns) I am attempting to isolate working with the File System. The FileSystem object uses the System.IO namespace. The CodeManager uses the FileManager to search the file system and Contains a List of CodeFiles.
I am researching by reading the following book:
Test-Driven Development in Microsoft® .NET
You can find it on amazon here
http://www.amazon.com/Test-Driven-Development-Microsoft-NET-Professional/dp/0735619484/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1221783997&sr=8-1
More updates when the mood hits.
Bill