-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Replacing part of assertion #5
Comments
I'm not sure how to approach this feature yet. I opened an issue on the Roslyn project, maybe they have a helper for something like this |
@jnyrup any idea what the code fix should be in the following case? actual.Should().NotBeNull("collection should not be null")
.And.NotBeEmpty("collection should not be empty")
.And.HaveCount(2); |
Are you referring to the problem about which If it was my own code using FA I would just write: actual.Should().NotBeNullOrEmpty("collection should not be empty")
.And.HaveCount(2); But of course the analyzer needs to be general.
|
exactly! @jnyrup just came up with a way to do the replacement - here is a snippet https://gist.github.com/Meir017/48eef45a5b2525ce21ff12de0bae5dc0 how weird is this? ;) I tried using |
started work on the branch feature/replacing-part-of-assertion |
Sounds great! |
@jnyrup 0.4.0 is up on NuGet now |
When verifying multiple assertions against the same object, you often combine them with
.And
.Currently it seems the codefixer is not aware of this concept.
is replaced with
The text was updated successfully, but these errors were encountered: