Hi Richard,
Sorry, I misunderstood what you wanted.
In general a small example demonstrating what you need will go a long way in helping us understand you better.
Anyway, here is an example that shows how to mock a specific method from on a given instance. (In this example the method is declared on the parent class, but this will work on on all other methods as well)
public class BaseClass
{
public int MethodInBase()
{
return 5;
}
}
public class UnderTest : BaseClass
{
public int OtherMethod()
{
return 6;
}
}
[TestMethod]
[VerifyMocks]
public void MockingSpecificMethod_AndExecutingTheRestNormally()
{
UnderTest target = new UnderTest();
using (RecordExpectations rec = new RecordExpectations())
{
target.MethodInBase();
rec.Return(10);
}
Assert.AreEqual(10, target.MethodInBase());
Assert.AreEqual(6, target.OtherMethod());
}
As you can see only the call MethodInBase was mocked while all other calls will go to real code. By default this is the expected behavior for concrete classes.
:!: This behavior will change if you are mocking interfaces.
Anyway I hope this is what you meant. if not please post a short example and I'm sure we will manage to find a good answer for you.