, , , .
-, . . , .
{
bool wasAbstractMethodCalled = false;
var targetStub = new StubFooClass()
{
WhatIWantToShim01 = () => wasAbstractMethodCalled = true
};
ShimFooClass.AllInstances.RandomMethod = @class => targetStub.CalculatePi();
targetStub.WhatIWantToShim();
Assert.IsTrue(wasAbstractMethodCalled, "The WhatIWantToShim method was not called.");
}
, . , .
, . , , . , , . , , - , .
, , , . . , , ; ( ) ( DI - !), , , , - .