WebApplicationFactoryContentRootAttribute クラス

定義

WebApplicationFactory<TEntryPoint> 使用して、 で TEntryPoint表される Web アプリケーションのコンテンツ ルートを調べるメタデータ。 WebApplicationFactory<TEntryPoint> は、 のすべてのインスタンス WebApplicationFactoryContentRootAttributeを反復処理し、 が と等しいインスタンス KeyTEntryPointFullNameフィルター処理し Priority 、昇順で並べ替えます。 WebApplicationFactory<TEntryPoint>は にマーカーPath.Combine(ContentRootPath, Path.GetFileName(ContentRootTest))"が存在することをチェックし、ファイルが存在する場合はコンテンツ ルートを にContentRootPath設定します。

public ref class WebApplicationFactoryContentRootAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true, Inherited=false)]
public sealed class WebApplicationFactoryContentRootAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true, Inherited=false)>]
type WebApplicationFactoryContentRootAttribute = class
    inherit Attribute
Public NotInheritable Class WebApplicationFactoryContentRootAttribute
Inherits Attribute
継承
WebApplicationFactoryContentRootAttribute
属性

コンストラクター

名前 説明
WebApplicationFactoryContentRootAttribute(String, String, String, String)

WebApplicationFactoryContentRootAttribute の新しいインスタンスを初期化します。

プロパティ

名前 説明
ContentRootPath

特定のプロジェクトのコンテンツ ルート パスを取得します。 このコンテンツ ルートには、相対または絶対を指定できます。 相対パスの場合は、 と BaseDirectory組み合わされます。

ContentRootTest

コンテンツ ルートが設定されているパスが正しいことを確認するために使用されるマーカー ファイル。

Key

このプロジェクトに関連付けられているコンテンツ ルートのキーを取得します。 通常 FullNameは 。

Priority

テスト Assemblyに同じキーを持つ複数WebApplicationFactoryContentRootAttributeのインスタンスが存在する場合のプローブ順序を決定するための数値を取得します。

適用対象