Skip to content

Add ability to capture and verify on an argument at the same time #781

Open
@asos-AdamCox

Description

@asos-AdamCox

Is your feature request related to a problem? Please describe.
I've found in the past that when a mocked interface takes a large object it can make the verification of a call very large. This can mean the code isn't very readable and the failure message isn't able to distinguish exactly which field didn't match in the call vs. the verification.

Describe the solution you'd like
The best approach I've found is to split up the verification into a simple verification which just uniquely identifies a call and captures the complex object(s) and then subsequent assertions against the fields in those complex objects.

Describe alternatives you've considered
Can't really think of alternatives. The way I'm looking to solve it is already implemented in Moq.

Additional context
I've raised a PR that would allow the above (#780) this is my first NSubstitute PR and actually my first OSS PR so I'm more than happy to make changes if you folks feel there's a better way of doing it.

Metadata

Metadata

Assignees

Labels

feature-requestRequest for a new NSubstitute feature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions