Freigeben über


WebApplicationFactoryContentRootAttribute Konstruktor

Definition

Initialisiert eine neue Instanz von WebApplicationFactoryContentRootAttribute.

public:
 WebApplicationFactoryContentRootAttribute(System::String ^ key, System::String ^ contentRootPath, System::String ^ contentRootTest, System::String ^ priority);
public WebApplicationFactoryContentRootAttribute(string key, string contentRootPath, string contentRootTest, string priority);
new Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactoryContentRootAttribute : string * string * string * string -> Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactoryContentRootAttribute
Public Sub New (key As String, contentRootPath As String, contentRootTest As String, priority As String)

Parameter

key
String

Der Schlüssel dieses WebApplicationFactoryContentRootAttribute. Dieser Schlüssel wird von WebApplicationFactory<TEntryPoint> verwendet, um zu bestimmen, welche WebApplicationFactoryContentRootAttribute Der Instanzen in der Testassembly verwendet werden sollen, um einer bestimmten TEntryPoint-Klasse zu entsprechen.

contentRootPath
String

Der Pfad zum Inhaltsstamm. Dieser Pfad kann entweder relativ oder absolut sein. Falls der Pfad relativ ist, wird der Pfad mit GetCurrentDirectory()

contentRootTest
String

Eine Datei, die als Marker verwendet wird, um zu bestimmen, ob der Inhaltsstammpfad für den angegebenen Kontext korrekt ist.

priority
String

Die Priorität dieses Inhaltsstammattributes im Vergleich zu anderen Attributen. Wenn mehrere WebApplicationFactoryContentRootAttribute Instanzen für denselben Schlüssel angewendet werden, werden sie mit Parse(String)verarbeitet, in aufsteigender Reihenfolge sortiert und mit Priorität angewendet, bis eine Übereinstimmung gefunden wird.

Gilt für: