Поделиться через


GlobalTestInitializeAttribute Class

Definition

A global test initialize attribute that applies to every test method in the assembly. The method to which this attribute is applied must be public, static, non-generic, has a single parameter of type TestContext, and either returns void or a Task.

[System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)]
public sealed class GlobalTestInitializeAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)>]
type GlobalTestInitializeAttribute = class
    inherit Attribute
Public NotInheritable Class GlobalTestInitializeAttribute
Inherits Attribute
Inheritance
GlobalTestInitializeAttribute
Attributes

Remarks

Multiple methods with this attribute in the assembly is allowed, but there is no guarantee of the order in which they will be executed. In addition, TimeoutAttribute isn't supported on methods with this attribute.

Applies to