- Last edited April 12, 2001 |
Solution: Extract B's interface in IB and provide an implementation of IB with MockB?. MockB? can verify if appriopriate methods are called. To do that, MockB? is part of the test framework.
Abstract classes have a similar problem. They often implement some mechanisms and use template methods to call subclass functionality. So say i have an abstract class AA which calls method M, i would like to have a MockObject MockSA? which verifies that method M is called.
Problem: i can't derive MockSA? from A. How do you cope with this guy's? -- RobWestgeest?
Maybe my real problem is MockType?. Why is it derived from TestCase? Why isn't it an Interface? -- RobWestgeest?
I imported the bigben107.dat in VA and used the XPdeveloper Testing 2.33 project. Are there newer versions? -- RobWestgeest?
As for testing abstract classes, we find that we tend to end up with a test class hierarchy that mirrors the target class hierarchy. This often gives us an abstract test class that mirrors the abstract target class and which is extended by the appropriate test class. That said, we don't usually set out to achieve this structure, we get there by refactoring. If you look in the test cases for the expectation library, you'll see something similar for testing the expectation collections. --SteveF
If you suggest that there is an ExpectationCollection? hierarchie (i.e. ExpectationList? and ExpectationSet? derived from an ExpectationCollection? base class) and a Verifiable interface I most definitely have the wrong version. Is there an update? --RobWestgeest?
Try www.mockobjects.com
- Last edited April 12, 2001 |