MetalamaAPI documentationAdvanced APIMetalama.​Testing.​Unit­TestingTest­ContextTest­Context
Open sandboxFocus

TestContext Constructor

TestContext(TestContextOptions)

Initializes a new instance of the TestContext class. Tests typically do not call this constructor directly, but instead the CreateTestContext(IAdditionalServiceCollection) method.

Declaration
public TestContext(TestContextOptions contextOptions)
Parameters
Type Name Description
TestContextOptions contextOptions

TestContext(TestContextOptions, IAdditionalServiceCollection, String)

Declaration
public TestContext(TestContextOptions contextOptions, IAdditionalServiceCollection additionalServices = null, string testName = null)
Parameters
Type Name Description
TestContextOptions contextOptions
IAdditionalServiceCollection additionalServices
String testName

TestContext(TestContextOptions, IAdditionalServiceCollection)

Initializes a new instance of the TestContext class and specify an optional IAdditionalServiceCollection. Tests typically do not call this constructor directly, but instead the CreateTestContext(IAdditionalServiceCollection) method.

Declaration
public TestContext(TestContextOptions contextOptions, IAdditionalServiceCollection additionalServices = null)
Parameters
Type Name Description
TestContextOptions contextOptions
IAdditionalServiceCollection additionalServices