WebApplicationFactoryContentRootAttribute 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
中繼資料, WebApplicationFactory<TEntryPoint> 用來找出 TEntryPoint
所代表之 web 應用程式的內容根目錄。
WebApplicationFactory<TEntryPoint>將逐一查看的所有實例 WebApplicationFactoryContentRootAttribute 、篩選等於 TEntryPoint 的實例 Key ,並 FullName 依 Priority 遞增順序排序。
WebApplicationFactory<TEntryPoint> 將會檢查路徑中的標記是否存在
。結合 (ContentRootPath ,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 |
取得數位,以在測試中有多個 WebApplicationFactoryContentRootAttribute 具有相同索引鍵的實例時判斷探查順序 Assembly 。 |