Edit on GitHub

xUnit1000 Error

Test classes must be public

Cause

A class containing test methods is not public.

Reason for rule

xUnit.net 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

using Xunit;

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

Does not violate

using Xunit;

public class xUnit1000
{
    [Fact]
    public void TestMethod()
    { }
}
Copyright © .NET Foundation. Contributions welcomed at https://github.com/xunit/xunit/tree/gh-pages.