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

xunit: define codefixes for TypeAsserts #146

Closed
8 tasks done
Tracked by #130
Meir017 opened this issue Jan 11, 2022 · 1 comment
Closed
8 tasks done
Tracked by #130

xunit: define codefixes for TypeAsserts #146

Meir017 opened this issue Jan 11, 2022 · 1 comment

Comments

@Meir017
Copy link
Member

Meir017 commented Jan 11, 2022

The asserts defined in https://github.com/xunit/assert.xunit/blob/main/TypeAsserts.cs

@Meir017
Copy link
Member Author

Meir017 commented Jun 9, 2023

// Xunit
XunitAssert.IsType<string>("foo");
XunitAssert.IsType(typeof(string), "foo");

// FluentAssertions
"foo".Should().BeOfType<string>();
"foo".Should().BeOfType(typeof(string));

// Xunit
XunitAssert.IsNotType<string>("foo");
XunitAssert.IsNotType(typeof(string), "foo");

// FluentAssertions
"foo".Should().NotBeOfType<string>();
"foo".Should().NotBeOfType(typeof(string));

// Xunit
XunitAssert.IsAssignableFrom<string>("foo");
XunitAssert.IsAssignableFrom(typeof(string), "foo");

// FluentAssertions
"foo".Should().BeAssignableTo<string>();
"foo".Should().BeAssignableTo(typeof(string));

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

No branches or pull requests

1 participant