5.4. Expecting Stub Invocation: vstubs

When you define a stub, there is no implicit expectation that it must be invoked in order for the Exemplar or JUnit test to pass successfully.

If you want to make it mandatory for a stub to be invoked from within an Exemplar, you can use the vstubs Exemplar property rather than stubs.  The vstubs property works exactly the same as the stubs property but raises a Sureassert UC Error against your Exemplar if any of the defined stubs are not invoked.

This is effectively behaviour verification based on stub definition.  You can verify any behaviour exhibited within your project code during Exemplar execution by using the verify property.  For more on this, see the Behaviour Verification section.

Previous Page   |   Next Page   |   Table of Contents

Comments are closed.