This is my code:
var mock = MockManager.Mock(typeof(LocationVersionViewModel));
mock.CallBase.ExpectAlways("AfterEditRevertBaseInputComponentVersion");
//creating the fakes
var fakeLocationVersion = Isolate.Fake.Instance<LocationVersionViewModel>(Members.CallOriginal, ConstructorWillBe.Ignored, BaseConstructorWillBe.Ignored);
var newWipfakeLocationVersion = Isolate.Fake.Instance<LocationVersionViewModel>(Members.CallOriginal, ConstructorWillBe.Ignored, BaseConstructorWillBe.Ignored);
//fake static calls
Isolate.Fake.StaticMethods(typeof (LocationVersionViewModel));
//act
fakeLocationVersion.AfterEditRevertBaseInputComponentVersion(null, newWipfakeLocationVersion);
//assert
Isolate.Verify.WasCalledWithAnyArguments(() => LocationVersionViewModel.AddEmptyLocationRowIfNeeded(newWipfakeLocationVersion));
LocationVersionViewModel inherits from BaseInputComponentVersion. BaseInputComponentVersion has a virtual method called AfterEditRevertBaseInputComponentVersion that is overrided by LocationVersionViewModel , and there, I call Base.AfterEditRevertBaseInputComponentVersion .
My goal is to ignore the call to Base.AfterEditRevertBaseInputComponentVersion within LocationVersionViewModel.
Although I have this line: mock.CallBase.ExpectCall("AfterEditRevertBaseInputComponentVersion")
The method AfterEditRevertBaseInputComponentVersion is being call on the base class of LocationVersionViewModel.
Am I doing something wrong?
Thanks,
Busi