Class CultureAttribute
Marks an assembly, test fixture or test method as applying to a specific Culture.
Implements
Inherited Members
Namespace: NUnit.Framework
Assembly: nunit.framework.dll
Syntax
[AttributeUsage(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
public class CultureAttribute : IncludeExcludeAttribute, IApplyToTestConstructors
View SourceCultureAttribute()
Constructor with no cultures specified, for use with named property syntax.
Declaration
public CultureAttribute()CultureAttribute(string?)
Constructor taking one or more cultures
Declaration
public CultureAttribute(string? cultures)Parameters
| Type | Name | Description | 
|---|---|---|
| string | cultures | Comma-delimited list of cultures | 
Methods
View SourceApplyToTest(Test)
Causes a test to be skipped if this CultureAttribute is not satisfied.
Declaration
public void ApplyToTest(Test test)Parameters
| Type | Name | Description | 
|---|---|---|
| Test | test | The test to modify | 
IsCultureSupported(string)
Test to determine if the a particular culture or comma- delimited set of cultures is in use.
Declaration
public bool IsCultureSupported(string culture)Parameters
| Type | Name | Description | 
|---|---|---|
| string | culture | Name of the culture or comma-separated list of culture ids | 
Returns
| Type | Description | 
|---|---|
| bool | True if the culture is in use on the system | 
IsCultureSupported(string[])
Test to determine if one of a collection of cultures is being used currently.
Declaration
public bool IsCultureSupported(string[] cultures)Parameters
| Type | Name | Description | 
|---|---|---|
| string[] | cultures | 
Returns
| Type | Description | 
|---|---|
| bool |