Skip to content

Conversation

@Tenno641
Copy link
Contributor

@Tenno641 Tenno641 commented Nov 20, 2025

Fixes xunit/xunit#3446 - Code fixer was incorrectly removing second argument (userMessage) when converting Assert.True(!false) to Assert.False(false)

  • Modified BooleanAssertsShouldNotBeNegatedFixer to preserve all arguments
  • Added tests for userMessage, multiple arguments, and named arguments
  • Existing test case continues to work as before

Fixes #3446 - Code fixer was incorrectly removing second argument (userMessage) when converting Assert.True(!false) to Assert.False(false)

- Modified BooleanAssertsShouldNotBeNegatedFixer to preserve all arguments
- Added comprehensive tests for userMessage, multiple arguments, and named arguments
- Existing simple case continues to work as before
@Tenno641
Copy link
Contributor Author

@dotnet-policy-service agree

@bradwilson
Copy link
Member

Thanks for the PR!

The new tests are not passing in the automated PR build (failing in all three OSes, so it doesn't seem to be OS-specific).

@Tenno641 Tenno641 closed this Nov 20, 2025
@Tenno641 Tenno641 force-pushed the fix-x2022-preserve-user-message branch from 29917be to 5bc8d31 Compare November 20, 2025 18:40
@Tenno641 Tenno641 reopened this Nov 20, 2025
@Tenno641
Copy link
Contributor Author

Hey @bradwilson
Sorry for the mess with this PR, I couldn’t fix the failing test yet, so I’ll close it for now and try again later. Thanks for your patience!

@Tenno641 Tenno641 closed this Nov 20, 2025
@Tenno641 Tenno641 deleted the fix-x2022-preserve-user-message branch November 20, 2025 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

xUnit2022 code fixer removes the second argument

2 participants