Skip to content

HaveCount with special cases for 0 or 1 #12

@jnyrup

Description

@jnyrup

This is really just a nice to have.

list.Count().Should().Be(0);
list.Count().Should().Be(1);

are correctly simplified into:

list.Should().HaveCount(0);
list.Should().HaveCount(1);

It would be nice, if they could be simplified directly into the ContainSingle and BeEmpty instead.

list.Should().ContainSingle();
list.Should().BeEmpty();

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