SonarQube Version: 8.1.0.31237
Xunit Version: 2.4.1
We just upgraded our Sonar server to 8.1 and started getting some false positives around S2699: Tests should include assertions.
We have written some of our tests to do the assertions in another method to cut down on code duplication. It appears that the scanner doesn’t check the methods called in the test for assertions.
Any ideas/suggestions?
[Fact]
public void Test1()
{
Test_BasicData(false, false, "ConfigTests");
}
public void Test_BasicData(bool test1, bool test2, string paramTest)
{
// assertions here
}
Thanks!
Russell