WebApplicationFactoryContentRootAttribute Kelas

Definisi

Metadata yang WebApplicationFactory<TEntryPoint> menggunakan untuk mengetahui akar konten untuk aplikasi web yang diwakili oleh TEntryPoint. WebApplicationFactory<TEntryPoint> akan melakukan iterasi atas semua instans WebApplicationFactoryContentRootAttribute, memfilter instans yang Key sama dengan TEntryPointFullName, mengurutkannya dengan Priority dalam urutan naik. WebApplicationFactory<TEntryPoint> akan memeriksa keberadaan penanda di Path.Combine(ContentRootPath, Path.GetFileName(ContentRootTest))" dan apakah file ada akan mengatur akar konten ke 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
Warisan
WebApplicationFactoryContentRootAttribute
Atribut

Konstruktor

WebApplicationFactoryContentRootAttribute(String, String, String, String)

Menginisialisasi instans baru .WebApplicationFactoryContentRootAttribute

Properti

ContentRootPath

Mendapatkan jalur akar konten untuk proyek tertentu. Akar konten ini bisa relatif atau absolut. Jika itu adalah jalur relatif, itu akan dikombinasikan dengan BaseDirectory.

ContentRootTest

File penanda yang digunakan untuk memastikan bahwa jalur akar konten sedang diatur ke sudah benar.

Key

Mendapatkan kunci untuk akar konten yang terkait dengan proyek ini. FullNameBiasanya .

Priority

Mendapatkan angka untuk menentukan urutan pemeriksaan ketika beberapa WebApplicationFactoryContentRootAttribute instans dengan kunci yang sama ada pada pengujian Assembly.

Berlaku untuk