Skip to content

Add Should().All() feature #1179

@Brondahl

Description

@Brondahl

I very often want to make an assertion about every member of a collection.
You can use .Should().OnlyContain() but I'd like to be able to use your lovely library of helper assertions.

e.g. I'd like to be able to write:
myStrings.Should().All().StartWith("Hello");

It feels like it ought to be relatively achievable?
Roughly speaking .All() would need to return an object that looked the same as a .Should() of the Collection contents but which passes all of its implementations down to an inner .Should() against each of the elements.

First Question: Would you be happy with this functionality existing?

Second Question: Is this something that you'd be likely to implement any time soon?
If not, would you accept a PR for it? And do you think such a change would be tractable to an experienced .NET programmer who's never looked inside your codebase before?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions