site/xunit.analyzers/rules/xUnit9002.md
A violation of this rule occurs when a public static property is required for SkipUnless or SkipWhen but one was not found.
There are a few ways you can violate this rule:
boolThis rules applies everywhere you see SkipUnless and SkipWhen; that is, [Fact] and [Theory] (and friends) as well as data attributes like [MemberData].
To fix a violation of this rule, ensure the named property exists and follows all the rules.
using Xunit;
public class xUnit9002
{
static bool AlwaysTrue => true;
[Fact(Skip = "Conditionally Skipped", SkipWhen = nameof(AlwaysTrue))]
public void NonPublic_Fact() { }
}
using Xunit;
public class xUnit9002
{
public static bool AlwaysTrue => true;
[Fact(Skip = "Conditionally Skipped", SkipWhen = nameof(AlwaysTrue))]
public void NonPublic_Fact() { }
}