How Do I Unit Test The Methods In A Method Object?
I've performed the 'Replace Method with Method Object' refactoring described by Beck. Now, I have a class with a 'run()' method and a bunch of member functions that decompose the c
Solution 1:
I like your answer, but i disagree.
The situation where you would use this design pattern is one where there is a fairly complex operation going on. As a result being abel to verify the individual components of such an operation i would say is highly desirable.
You then have the issue of dependancies on other resources (which may or may not be true in this case).
You need to be able to use some form of ioc in order to inject some form of mock to isolate the class.
Besides most mocking frameworks will provide you with accessors to get at the private members.
Post a Comment for "How Do I Unit Test The Methods In A Method Object?"