A test has the same data row twice, so one case runs twice and was probably meant to be another

tx0/csharp:duplicate-test-datarecommendedwarningmaintainability/testsdepth fastbug

What it finds

Two identical [InlineData], [TestCase] or [DataRow] rows on one test run the same case twice; usually one of them was copied and not edited. xUnit also refuses to list duplicate rows as separate tests.

From the rule's source, duplicate_test_data.rs.

Example from the rule's tests
using Xunit; public class Parsing{    [Theory]    [InlineData("1")]    [InlineData("2")]    [InlineData("1")]tx0 reports: this data row repeats an earlier one    public void Parses(string text)    {    }}
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

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:

tx0.toml
[rules]
"tx0/csharp:duplicate-test-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:duplicate-test-data] reason="..."

tx0 explain tx0/csharp:duplicate-test-data shows the same in the terminal. Found a false positive? Report it.