Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ComparableTypeAssertions should have BeOneOf method #2027

Closed
jez9999 opened this issue Nov 1, 2022 · 2 comments · Fixed by #2028
Closed

ComparableTypeAssertions should have BeOneOf method #2027

jez9999 opened this issue Nov 1, 2022 · 2 comments · Fixed by #2028

Comments

@jez9999
Copy link
Contributor

jez9999 commented Nov 1, 2022

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?

@dennisdoomen
Copy link
Member

Indeed. We would welcome a PR.

@jez9999
Copy link
Contributor Author

jez9999 commented Nov 1, 2022

@dennisdoomen PR submitted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants