Hey guys,
I’m having trouble doing one more thing with Type Mock.
I have a base class as below with multiple derived classes. I want to mock ALL INSTANCES of the Discover method on the base class. The method is not virtual. Unfortunately, the only way I was able to get this to work was to mock All Instances of DerivedClassA.Discover and also all instances of DerivedClassB.Discover. That isn’t an elegant solution because there could be lots of derived classes. Is there a way to mock methods on a Base class without needing to know what the derived class is?
Public class BaseClass
{
Public void Discover();
}
Public class DerivedClassA : BaseClass
{
}
Public class DerivedClassB : BaseClass
{
}
Thanks,
James