let's say I have this class
public class MyClass
{
public void InnerMethod(){}
public void OuterMethod(SomeType sameValue)
{
if(someCondition)
{
InnerMethod();
}
else
{
...
}
}
}
I want to check that the InnerMethod was called
[Fact]
public void CanDoSomething()
{
var sut = new MyClass();
sut.OuterMethod(someValue);
//Assert that InnerMethod was called
}
If InnerMethod belonged to a mocked object, I would have just called mockObject.Verify(x => x.InnerMethod);
. However, InnerMethod is a concrete method belonging to the sut itself.
How to check that InnerMethod was called.
Thanks for helping.