Local functions cannot be test functions
A test method must be directly inside a class. Local functions (that is, functions defined inside other code blocks) are not supported.
xUnit.net does not look for local functions to find tests, as they are not supported.
To fix a violation of this rule, move the test function to class-level.
using Xunit;
public class xUnit1029
{
private void NonTestMethod()
{
[Fact]
void TestMethod()
{
// ...
}
}
}
using Xunit;
public class xUnit1029
{
[Fact]
void TestMethod()
{
// ...
}
private void NonTestMethod()
{
// ...
}
}