Skip to content

Add version of StringAssertions.Contain that allows specifying the number of times a substring should occur. #818

@basbossink

Description

@basbossink

Currently StringAssertions has no easy way of asserting that a substring should occur a particular number of times within a string. Imagine the syntax could be something like

actual.Shoud().Contain("Fred", Twice, "Fred is important");

or

actual.Should().Contain("Fred").Twice("Fred is important");

or

actual.Should().Contain("Fred", 2, "Fred is important");

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions