-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
One thing that comes up when using specs is how to test them and how to test things which consume them. What this is really about is the consumption of specification objects. Whether they're consumed as interfaces or concrete classes, and the consequences of this for testing.
There are a few ways:
- Write one-line interfaces for each spec
- Then the dev just mocks the interface as usual
- Use virtual members which can be overridden
- No need for an extra interface, and the dev can mock an object with virtual members
- Write and use a service locator
- Anti-pattern but it would work to provide specs as interfaces
These techniques should be documented.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request