Edit on GitHub

xUnit1027   v2 v3   Error

Collection definition classes must be public

Cause

A collection definition class is not public.

Reason for rule

xUnit.net will not discover the collection definition class if the class is not public.

How to fix violations

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

Examples

Violates

using Xunit;

[CollectionDefinition("CollectionName")]
class CollectionDefinitionClass
{ }

Does not violate

using Xunit;

[CollectionDefinition("CollectionName")]
public class CollectionDefinitionClass
{ }
Copyright © .NET Foundation. Contributions welcomed at https://github.com/xunit/xunit/tree/gh-pages.