Which isolation method should you use?

You are authoring unit tests. The unit tests must test code that consumes sealed classes.
You need to create, maintain, and inject dependencies in the unit tests. Which isolation
method should you use?

You are authoring unit tests. The unit tests must test code that consumes sealed classes.
You need to create, maintain, and inject dependencies in the unit tests. Which isolation
method should you use?

A.
T4 text templates and code generation

B.
Stub types

C.
Shim types

D.
Hard-coded implementation



Leave a Reply 1

Your email address will not be published. Required fields are marked *


someguy

someguy

Stubs implement interfaces or override members. But our dependencies are sealed, so that’s not an option.

A and D are meaningless here, I think.

That leaves shims, which are typically used for external dependencies which we can’t override (i.e. sealed.)