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

using Xunit;

public class xUnit1003
{
    [Theory]
    public void TestMethod(int _) { }
}

Does not violate

using Xunit;

public class xUnit1003
{
    [Fact]
    public void TestMethod() { }
}
using Xunit;

public class xUnit1003
{
    [Theory]
    [InlineData(5)]
    public void TestMethod(int _) { }
}
Copyright © .NET Foundation. Contributions welcomed at https://github.com/xunit/xunit/tree/gh-pages.