I have a subclass that overrides a method:
public class Parent {
public virtual string Foo(string s) {
//...
}
}
public class Child : Parent {
public override string Foo(string s) {
s = s "123";
return base.Foo(s); // <---- how do I detect this call?
}
}
I can test that the overridden method was called:
var mock = Substitute.ForPartsOf<Child>();
mock.Foo("abc");
mock.Received(1).Foo(Arg.Any<string>());
But how can I detect that the BASE method was called?
CodePudding user response:
As per @DavidTchepak's comment, this is a limitation of the underlying framework. Cannot be done, but one can redesign to avoid this issue.