Class NetPlatformAttribute
Marks an assembly, test fixture or test method as applying to a specific platform.
Implements
Inherited Members
Namespace: NUnit.Framework
Assembly: nunit.framework.dll
Syntax
[AttributeUsage(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Method, AllowMultiple = true, Inherited = false)]
public class NetPlatformAttribute : IncludeExcludeAttribute, IApplyToTestRemarks
This class is a replacement for the PlatformAttribute class, the platform names are based on the values in the TargetFramework. See: https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1416
Constructors
View SourceNetPlatformAttribute()
Constructor with no platforms specified, for use with named property syntax.
Declaration
public NetPlatformAttribute()NetPlatformAttribute(string?)
Constructor taking one or more platforms
Declaration
public NetPlatformAttribute(string? platforms)Parameters
| Type | Name | Description | 
|---|---|---|
| string | platforms | Comma-delimited list of platforms | 
Methods
View SourceApplyToTest(Test)
Causes a test to be skipped if this NewPlatformAttribute is not satisfied.
Declaration
public void ApplyToTest(Test test)Parameters
| Type | Name | Description | 
|---|---|---|
| Test | test | The test to modify |