Skip to content

ComparableTypeAssertions should have BeOneOf method #2027

@jez9999

Description

@jez9999

Because ComparableTypeAssertions doesn't contain BeOneOf, the following code doesn't work:

float testFloat = 12f;
var testTuple = (1, 2);

testFloat.Should().BeOneOf(12f, 13f); // Works
testTuple.Should().BeOneOf((1, 2), (1, 3)); // Doesn't work

I don't see any technical reason why the latter shouldn't work, so how about adding BeOneOf to ComparableTypeAssertions?

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