Isolator Extensibility – Verifying An Instance Was Not Called

Using Isolator’s Verify (C#) or Assert.TheseCalls, we have the option to use WasNotCalled (or VB DidNotHappen) to verify a method was not called.

What if I want to check that on a single instance, any of the methods were not called?

I’ll use a bit of reflection to get all the method names, and use the Verify.NonPublic version of WasNotCalled to make sure the calls weren’t made.

So if my test looks like this:

And the VerifyInstanceWasNotCalled looks like this:

And you’ve got yourself a verification method for the whole method or interface.