WebApplicationFactoryContentRootAttribute Klasse

Definition

Metadaten, die verwendet, WebApplicationFactory<TEntryPoint> um den Inhaltsstamm für die Webanwendung zu ermitteln, die durch dargestellt wird TEntryPoint. WebApplicationFactory<TEntryPoint> durch iteriert alle Instanzen von WebApplicationFactoryContentRootAttribute, filtert die Instanzen, deren Key Gleich TEntryPointFullNameist, und sortiert sie Priority nach in aufsteigender Reihenfolge. WebApplicationFactory<TEntryPoint> überprüft, ob der Marker in Path.Combine(ContentRootPath, Path.GetFileName(ContentRootTest))" vorhanden ist, und wenn die Datei vorhanden ist, wird der Inhaltsstamm auf ContentRootPathfestgelegt.

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
Vererbung
WebApplicationFactoryContentRootAttribute
Attribute

Konstruktoren

WebApplicationFactoryContentRootAttribute(String, String, String, String)

Initialisiert eine neue Instanz von WebApplicationFactoryContentRootAttribute.

Eigenschaften

ContentRootPath

Ruft den Inhaltsstammpfad für ein bestimmtes Projekt ab. Dieser Inhaltsstamm kann relativ oder absolut sein. Wenn es sich um einen relativen Pfad handelt, wird er mit BaseDirectorykombiniert.

ContentRootTest

Eine Markerdatei, mit der sichergestellt wird, dass der Pfad, auf den der Inhaltsstamm festgelegt wird, korrekt ist.

Key

Ruft den Schlüssel für den Inhaltsstamm ab, der diesem Projekt zugeordnet ist. In der Regel FullName.

Priority

Ruft eine Zahl zum Bestimmen der Untersuchungsreihenfolge ab, wenn mehrere WebApplicationFactoryContentRootAttribute Instanzen mit demselben Schlüssel im Test Assemblyvorhanden sind.

Gilt für: