Edit on GitHub

xUnit1000 Error

Test classes must be public

Cause

A class containing test methods is not public.

Reason for rule

xUnit will not run the test methods in a class if the class is not public.

How to fix violations

To fix a violation of this rule, make the test class public.

Examples

Violates

class TestClass
{
    [Fact]
    public void TestMethod()
    {
    }
}

Does not violate

public class TestClass
{
    [Fact]
    public void TestMethod()
    {
    }
}
Copyright © 2017 .NET Foundation. Contributions welcomed at https://github.com/xunit/xunit.analyzers.