Skip to content

Prevent Expectations From Being Set After Mock is Made #294

@JasonBock

Description

@JasonBock

Describe the solution you'd like
It's possible to create an expectation after a mock is made. This shouldn't be allowed - the design is meant to say, "make your expectations first, then use the mock, then verify it." This can be changed by throwing an ExpectationException when an expectation is set after the mock is made:

ExpectationException.ThrowIf(bool wasMockCreated);

This would be added as the first line of code in each expectation implementation.

Also, while I'm at it, add memberIdentifier to Verify() and pass that value into GetMemberDescription().

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions