I have a situation where some procedure returns an object (kind of like a DTO) with a certain interface:
interface ISomeInterface
{
string StringReadOnlyProperty { get; }
int IntReadWriteProperty { get; set; }
}
(In the real implementation, there are more properties).
There are two different places where these objects are handled - one process that generates new instances, and another process that manipulates existing instances. Internally, these two implementations are very different. The "new" instance is just a stub, and the "existing" instance has lots of tracking logic.
So I need to have this "Stub" implementation kicking around all the time. I was thinking about how nicely Rhino Mocks can stub up implementations of an interface without having to generate a concrete class. Has anyone ever used a "stubbing" mechanism like Rhino Mocks, but in their production code rather than in their unit tests? It just seems like a bad practice, because of the dependency to a testing framework.