locked
Where to put an adapter-class? RRS feed

  • Question

  • Hello everyone!

    This question is mostly a matter of how to make this good "kung-fu".

    To test a static function, the mocking framework demands me to provide a wrapper class (adapter pattern) for the class to be tested.

    Am I right to put this wrapper class into the test project or should it reside it in the project with the code to be tested?

    This sounded simple when I started thinking about it:

    Because the sole purpose of the class is to make another piece of code testable and because this particular code is never used by anything or anybody outside of the test project, it should go to the test project.

    But during the writing of it I got to this thought: I bring in a new piece of code that is actually tested. This does not sound like code that has his home in the test project.

    Please help me decide.

    Thanks in advance & best regards,

    Max

    Sunday, January 29, 2012 4:52 PM

Answers