Fact methods cannot have parameters
A fact method has one or more parameters.
A fact method is a non-parameterized test. xUnit.net will raise a runtime error if it sees a fact method with a non-empty parameter list.
To fix a violation of this rule, remove the parameters from the fact method. Alternatively, change the [Fact]
attribute to [Theory]
.
using Xunit;
public class xUnit1001
{
[Fact]
public void TestMethod(int _)
{ }
}
using Xunit;
public class xUnit1001
{
[Fact]
public void TestMethod()
{ }
}
using Xunit;
public class xUnit1001
{
[Theory]
public void TestMethod(int _)
{ }
}