AssertIsTrue: Simplify Assertion does not offer automatic fix to apply
See original GitHub issueDescription
AssertIsTrue: Simplify Assertion does not offer automatic fix to apply.
Complete minimal example reproducing the issue
This gets a suggestion but there is no fix shown to apply in VS.
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace TestProject1
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
Assert.IsTrue(true);
}
}
}
Expected behavior:
Fix suggestion should be shown.
Actual behavior:
Fix suggestion is not shown.
Versions
- Which version of Fluent Assertions Analyzers are you using? FluentAssertions.Analyzers 0.17.2
- Which .NET runtime and version are you targeting? .NET Core 3.1.
Issue Analytics
- State:
- Created a year ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Java static code analysis: JUnit assertTrue/assertFalse ...
Testing equality or nullness with JUnit's assertTrue() or assertFalse() should be simplified to the corresponding dedicated assertion.
Read more >Unit Testing and Coding: Why Testable Code Matters
In this article, I will show that unit testing itself is quite easy; the real problems that complicate unit testing, and introduce expensive...
Read more >The problem with Assert.IsTrue - Aaron Powell
Do you know what's wrong with this test? I'll give you a clue, the developer use Assert.IsTrue and by doing so they've made...
Read more >c# - MS Test assertion checking
There are many ways to do so: Debugging. Try debugging the Test instead of just running it. This will cause an exception beeing...
Read more >Stop requiring only one assertion per unit test
Assertion Roulette doesn't mean that multiple assertions are bad. When I coach teams or individual developers in test-driven development ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Meir017 This was just an example. The issue is that in general the fix never seems to be shown for this rule.
Example without a constant:
@Meir017 The scenario still reproduces on
0.20.0
- aka. there is no fix suggestion.