Table of Contents
  v2 v3   Error

xUnit1000

"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()
    { }
}