Skip to content

Custom Attributes

Chris Maddock edited this page Jun 25, 2017 · 11 revisions

NUnit 3 implements a great deal of its functionality in its attributes. This functionality is accessed through a number of standard interfaces, which are implemented by the attributes. Users may create their own attributes by implementing these interfaces.

For ease of understanding, the interfaces are grouped according to the stage in the life-cycle of a test at which they are used. The two primary stages in the life of a test are Load-Time and Execution-Time.

Load-Time Interfaces

Loading tests means loading the assembly into memory and examining its content to discover the classes and fixtures that represent tests. The internal structures that represent tests are built at this time. If requested by the application, information about the tests may be returned for display, as is done in the NUnit GUI runner.

The following interfaces are called at load time.

Interface Used By
[[IFixtureBuilder IFixtureBuilder-Interface]]
[[ITestBuilder ITestBuilder-Interface]]
[[ISimpleTestBuilder ISimpleTestBuilder-Interface]]
[[IImplyFixture IImplyFixture-Interface]]
[[IApplyToTest IApplyToTest-Interface]]

Execution-Time Interfaces

At execution-time, some or all of the tests that were previously loaded are actually run. Their results are returned and made available to the application.

The following interfaces are called at execution time.

Interface Used By
[[IApplyToContext IApplyToContext-Interface]]
[[ICommandWrapper ICommandWrapper-Interface]]
Clone this wiki locally