WebApplicationFactoryContentRootAttribute Constructor

Definition

Initializes a new instance of 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)

Parameters

key
String

The key of this WebApplicationFactoryContentRootAttribute. This key is used by WebApplicationFactory<TEntryPoint> to determine what of the WebApplicationFactoryContentRootAttribute instances on the test assembly should be used to match a given TEntryPoint class.

contentRootPath
String

The path to the content root. This path can be either relative or absolute. In case the path is relative, the path will be combined with GetCurrentDirectory()

contentRootTest
String

A file that will be use as a marker to determine that the content root path for the given context is correct.

priority
String

The priority of this content root attribute compared to other attributes. When multiple WebApplicationFactoryContentRootAttribute instances are applied for the same key, they are processed with Parse(String), ordered in ascending order and applied in priority until a match is found.

Applies to