TestMethodAttribute Sınıf
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Bu öznitelik, test yöntemlerini işaretlemek için kullanılır.
[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)]
[System.Runtime.CompilerServices.Nullable(0)]
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)>]
[<System.Runtime.CompilerServices.Nullable(0)>]
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
- Devralma
-
TestMethodAttribute
- Türetilmiş
- Öznitelikler
Açıklamalar
- veya DynamicDataAttributegibi DataRowAttribute diğer öznitelikleri kullanırken kullanımı TestMethodAttribute yine de gereklidir.
- Test yöntemleri şu şekilde olmalıdır:
- public veya kullanılıyorsa DiscoverInternalsAttribute iç olabilir.
- statik değil
- genel değil
- soyut değil
- dönüş türü , Taskveya ValueTaskşeklindedir
void.asyncisevoid, olmamalıdır.
Oluşturucular
| Name | Description |
|---|---|
| TestMethodAttribute() |
TestMethodAttribute sınıfının yeni bir örneğini başlatır. |
| TestMethodAttribute(String, Int32) |
TestMethodAttribute sınıfının yeni bir örneğini başlatır. |
| TestMethodAttribute(String) |
TestMethodAttribute sınıfının yeni bir örneğini başlatır. |
Özellikler
| Name | Description |
|---|---|
| DeclaringFilePath |
Özniteliğini bildiren dosya yolunu alır. |
| DeclaringLineNumber |
özniteliğini bildiren satır numarasını DeclaringFilePath alır. |
| DisplayName |
Test için görünen adı alır veya ayarlar. |
| UnfoldingStrategy |
Parametreli testleri açma stratejisini alır veya ayarlar. |
Yöntemler
| Name | Description |
|---|---|
| Execute(ITestMethod) |
Bir test yöntemi yürütür. |
| ExecuteAsync(ITestMethod) |
Bir test yöntemi yürütür. |