I have a class like this:
public class MyClass
{
public async Task MethodA()
{
await DoSomething();
}
public Task MethodB()
{
return MethodA();
}
}
I need to test that MethodB calls MethodA.
But how could I verify this?
I'm trying this:
var myClassMock = new Mock<MyClass>();
myClassMock.VerifyAll();
await myClassMock.Object.MethodB();
myClassMock.Verify(d => d.MethodA(), Times.Once);
And getting NotSupportedException: Invalid verify on a non-virtual (overridable in VB) member: d => d.MethodA().
Can I actually test it without using another mocking framework?