Exemplars allow you to declare example execution scenarios for your methods and assert how they should respond. They can be used to both bolster the contracts of your methods and, together with the Sureassert UC Engine, enforce them in real-time (as you save your code). This section covers the basics of how to write Exemplars and the notation used – Sureassert Simple Invocation Notation (SIN).
For information on configuring method and source level stubs, and test double classes, within your Exemplars, see the Test Isolation section.
For information on performing behaviour verification from within Exemplars, see the Behaviour Verification section.
- 3.1. Annotating Methods with Exemplars
- 3.2. Passing Method Arguments
- 3.3. SIN Expressions
- 3.4. Sureassert Named Instances
- 3.5. Specifying and Initializing the Object Under Test
- 3.6. Viewing Results and Other Test Information
- 3.7. Asserting Expected Results
- 3.8. Using Exemplars in Interfaces and Abstract Classes
- 3.9. Setup and Tear-down (before and after)
- 3.10. Further Documenting your Exemplars
- 3.11. Shorthand Exemplar Properties
- 3.12. Inner Classes