I'm not saying this because it's "best practice" or so, but it works for me. Usually when I'm in the early stages of coding I have simple tests (unit tests!) that test only a specific class. So most likely I have one test per class. So if my class name is "FileReader" I have a test class named "FileReaderTest." Then each method of my test class would test a particular functionality or behaviour of the class. I kinda name my tests with a "Should" -- similar to BDD. So it says "ShouldOpenFile" or "ShouldThrowExceptionIfFileNotFound" etc. I stick to CamelCase because that's how .NET code generally looks like. If I use ruby_case or some other convention, my code will stick out like a sore thumb and probably drive other developers in my team away.
answered
Dec 03 '09 at 10:21
cruizer
1.5k●9