I have an unit-test written with FakeItEasy v2.2.0.
The test tests that a method, let call it MethodA
call to MethodB
.
The simple class:
public class Foo
{
public virtual void MethodA()
{
MethodB();
}
public virtual void MethodB() { }
}
The simple test:
var foo_fake = A.Fake<Foo>(options => options.CallsBaseMethods());
foo_fake.MethodA();
A.CallTo(() => foo_fake.MethodA()).MustHaveHappened()
.Then(A.CallTo(() => foo_fake.MethodB()).MustHaveHappened());
With FakeItEasy 2.2.0, the code passed.
But when we upgrade to 5.1.0, the code throw exception that says:
The calls were found but not in the correct order among the calls
When we say the method is called? At the start of execution, or at the end?
Or, what is the right way to test this case?