Share via


TestMethodAttribute Class

Definition

This attribute is used to mark test methods.

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

Remarks

Constructors

TestMethodAttribute()

Initializes a new instance of the TestMethodAttribute class.

TestMethodAttribute(String, Int32)

Initializes a new instance of the TestMethodAttribute class.

TestMethodAttribute(String)

Initializes a new instance of the TestMethodAttribute class.

Properties

DeclaringFilePath

Gets the file path that declares the attribute.

DeclaringLineNumber

Gets the line number within DeclaringFilePath that declares the attribute.

DisplayName

Gets display name for the test.

UnfoldingStrategy

Gets the strategy for unfolding parameterized tests.

Methods

Execute(ITestMethod)

Executes a test method.

ExecuteAsync(ITestMethod)

Executes a test method.

Applies to