After a bit of searching the forums I believe this specific exception is a bug, but none of the solutions provided fix the underlying problem in my situation.
The static method I'm verifying is overloaded.
These are the relevant lines of code:
Isolate.Fake.StaticMethods<TISServicesHelpers>();
//do stuff
Isolate.Verify.WasCalledWithArguments(() => TISServicesHelpers.UpdateIndirectFulfilmentRequestRecord(
0,
EFulfilmentRequestStatusEnum.Cancelled)).Matching(args => (EFulfilmentRequestStatusEnum)args[1] == EFulfilmentRequestStatusEnum.Cancelled);
Adding an explicit WhenCalled for that static method did not help:
Isolate.WhenCalled(() => TISServicesHelpers.UpdateIndirectFulfilmentRequestRecord(0, EFulfilmentRequestStatusEnum.Cancelled)).IgnoreCall();
I can get the exact arguments Verify method to work however:
Isolate.Verify.WasCalledWithExactArguments(() => TISServicesHelpers.UpdateIndirectFulfilmentRequestRecord(
0,
EFulfilmentRequestStatusEnum.Cancelled))
However I was hoping not to use this.
Any suggestions? Thanks in advance.