Follow @RoyOsherove on Twitter
Fifteen things I look for in an Isolation framework
- Is the framework strict or non strict by default? Hopefully non strict.
- Is everything called a mock? Hopefully not. a fake? mock/stub differentiation?
- Does it have recursive fakes? Hopefully.
- How good are the error messages?
- What is the test style? record replay?arrange-assert-act? arrange-act-assert? hopefully the latter.
- How simple are the matchers for expected parameters to write?
- How easily can you create a mock logger that expects a string containing X at least once?
- How easily can you create a stub logger that simulates an exception, and a mock service that gets a message containing string if the logger throws. ([as specified here])
- Is the framework constrained or unconstrained? Important to know what it can and cannot do.
- Does stubbing a return value feel like setting an expectation? Hopefully not.
- When you verify - can you verify only a single specific call? hopefully. or do you have to verify all?
- Could you verify all if you wanted? hopefully not.
- Does the framework verify by default ? hopefully not.
- Does the framework encourage to verify all in the teardown? hopefully not.
- How easily can you verify you got an object with some properties or attributes?