Usually when writing unit tests I create a helper class with extension methods. I use these methods exclusively for generating generic data for things that I am too lazy to type out. I usually name these classes something relevant to the class under test - for example, I'll follow a pattern like TestHelper.cs. I've read that helper classes don't promote good design; however I know SOLID principles pretty well and I don't see how using helpers in the way described is violating any principles. I think the issue I'm having is with the name of my TestHelper ... Should I simply come up with a new naming scheme or am I really violating a SOLID Principle by utilizing these helpers?
What should I name this helper class?
c#;design patterns;naming;solid
This is not anti-SOLID at all, but you may want to consider the Object Mother pattern, which solves exactly the same problem in a similar way and has the added bonus of giving you a funky suffix to use in your class names.Plus, like all patterns, because they do have a name, any newcomer to the team can simply google the term Object Mother and find a wealth of information, explaining what it is you've done.