In the below given scenario, I have added reference to someExternal.Library.dll and derived a class named MyClass from BaseClass. MyClass invokes MakeCall() method of BaseClass internally in its methods. Here, the BaseClass is a concrete class which does not implement any Interface and also the MakeCall() method is a non-virtual method.
in such a scenario, how do I mock only the MakeCall() method of base class?
I want to write unit tests for MyClass
public class MyClass : BaseClass
{
public void DoSomething()
{
//someExternal.Library.dll is referenced to the project
// Makecall() is available to this class through inheritance
MakeCall();
...
}
public bool DoSomethingElse()
{
...
}
}
in the above snippet I want to write unit Test for MyClass and I should be able to Mock obj.MakeCall(); method call using MoQ.
NOTE: MOQ is the only mocking framework I am allowed to use