-
Notifications
You must be signed in to change notification settings - Fork 731
Closed
Labels
api-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationbreaking change
Milestone
Description
Although I'm still thinking about the design, I propose the following changes:
AssertionScopeis only used by consumers as they do now and by certain APIs such asBeEquivalentTo- Every
Shouldmethod will create a new object calledAssertion(but I'm open to a better name) that contains the context of the assertion and a link to the scope. When no ambientAssertionScopeis available, it will be a new one that is created at that point. This is different from v6 where we create a new scope per call toExecute.Assertion. - Every
Shouldmethod will also take an extra parameter annotated with[CallerArgumentExpression]. If this returns a non-nullvalue, we can use that instead of using theCallerIdentifier. - This
Assertioninstance will be explicitly passed to all the assertion classes (likeStringAssertions). - No public APIs will depend on
AssertionScope.Currentanymore - Most of the APIs that are now part of
AssertionScopewill need to move toAssertion. - This should allow methods like
ContainSingleto update theAssertioninstance with extra information to solve Misleading caller identity whenWhichfails #1502 - This should also allow us to drop
ClearExpectations - Also provides a nice split between the responsibility of
AssertionScopeas a way to group related assertions and its responsibilities as the internal assertion API
aracg
Metadata
Metadata
Assignees
Labels
api-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationbreaking change
Type
Projects
Status
✅ Done