An xUnit [Theory] has no data attribute, so it has no cases to run
What it finds
A theory runs once per row of data from [InlineData], [MemberData], [ClassData] or another data attribute. Without any, xUnit reports the theory as failed or skips it, depending on the version; either way nothing is tested. A test without parameters is a [Fact].
From the rule's source, theory_without_data.rs.
using Xunit; public class Parsing{ [Theory] // no data public void Empty(int n)tx0 reports: the theory Empty has no data { } [Theory] [InlineData(1)] public void One(int n) { }} Turn it on, off or suppress it
The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/csharp:theory-without-data" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/csharp:theory-without-data] reason="..."tx0 explain tx0/csharp:theory-without-data shows the same in the terminal. Found a false positive? Report it.