DEV Community

Discussion on: Using the Strategy Pattern (Examples in C#)

Collapse
 
bgadrian profile image
Adrian B.G.

Generally speaking, I am curious, how can one do automatic tests on this pattern?

First step would be to test each strategy implementation I presume.
Second would be to test if the correct strategy was selected based on the input?

Collapse
 
sam_ferree profile image
Sam Ferree

That’s how I’d do it, Unit test the concrete implementations, and selection, then Integration test both.