|
-
February 10th, 2005, 09:13 AM
#1
Possible to 'hot-swap' Objects?
Ok this may seem bizzar but I need something like this:
Class Alpha has method Pet.
The Implementation of Pet manipulates a Cat.
Lets say the exact nature of Cat is a Tabby.
Class Beta Derives from Alpha.
Beta does NOT have an implementation for Pet, it uses Alpha's implementation.
However, when I call 'pet' from Beta, I want the Exact nature of the Cat to be a Calico.
Now why do I want to do this? I have to Test the busniess logic of Alpha. I can not modify it in any way. The method I am testing, Pet makes a decision based on Cat's response. For testing purposes I want to make my own 'cat' who gives known responses, or more imporantly respones I want it to give. I can't really test method Pet without this.
Typically posts like this I make never get answered. If no one knows, is there some other forums I can use that have people more knowledable in such areas, espeically writting unit testable C++ code?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|