Edit on GitHub

xUnit1003 Error

Theory methods must have test data

Cause

A Theory method does not have test data.

Reason for rule

If a Theory method does not have test data, it is never run.

How to fix violations

Examples

Violates

public class TestClass
{
    [Theory]
    public void TestMethod(int p1)
    {
    }
}

Does not violate

public class TestClass
{
    [Fact]
    public void TestMethod()
    {
    }
}
public class TestClass
{
    [Theory]
    [InlineData(5)]
    public void TestMethod(int p1)
    {
        Assert.Equal(2 + 2, p1);
    }
}
Copyright © 2017 .NET Foundation. Contributions welcomed at https://github.com/xunit/xunit.analyzers.