| Property | Value |
|---|---|
| Package | Philips.CodeAnalysis.MsTestAnalyzers |
| Diagnostic ID | PH2055 |
| Category | MsTest |
| Analyzer | AssertIsTrueLiteralAnalyzer |
| CodeFix | No |
| Severity | Error |
| Enabled By Default | Yes |
Calling Assert.IsTrue(true) (or Assert.IsFalse(false)) serves no purpose.
Remove the line of code.
Code that triggers a diagnostic:
[TestMethod]
public void BadTestMethod()
{
Assert.IsTrue(true);
}Microsoft's official MSTest analyzers provide similar functionality with broader coverage:
| Microsoft Rule | Description |
|---|---|
| MSTEST0032 | Use proper assert methods |
Consider migrating to Microsoft's official MSTest analyzers which provide equivalent or better functionality with official support.
This analyzer does not offer any special configuration. The general ways of suppressing diagnostics apply.