NCover Documentation

MSTest Attributes Supported by Bolt

Attributes are used by both MSTest and NUnit to identify classes and methods that comprise a test suite. The attributes we have encountered most often with our customers are supported and listed below. Not all attributes are supported; but this is a work in progress.

AssemblyInitialize

Microsoft.VisualStudio.TestTools.UnitTesting.AssemblyInitializeAttribute

AssemblyCleanup

Microsoft.VisualStudio.TestTools.UnitTesting.AssemblyCleanupAttribute

TestClass

Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute

ClassInitialize

Microsoft.VisualStudio.TestTools.UnitTesting.ClassInitializeAttribute

DeploymentItem

Microsoft.VisualStudio.TestTools.UnitTesting.DeploymentItemAttribute

Deploy

Microsoft.VisualStudio.TestPlatform.MsTestFramework.UnitTesting.Deploy

TestInitialize

Microsoft.VisualStudio.TestTools.UnitTesting.TestInitializeAttribute

TestCleanup

Microsoft.VisualStudio.TestTools.UnitTesting.TestCleanupAttribute

Ignore

Microsoft.VisualStudio.TestTools.UnitTesting.IgnoreAttribute

In addition to attributes which define test elements, Bolt also supports TestContext items defined in two different MSTest frameworks:

Microsoft.VisualStudio.TestPlatform.MsTestFramework.UnitTesting.TestContext

Microsoft.VisualStudio.TestTools.UnitTesting.TestContext

NUnit Attributes Supported by Bolt

Most of the attributes defined in NUnit 2.0 specification have been implemented for support in Bolt.

Not all attributes are supported and some attributes may have limited implementation. Adding attribute support is an ongoing process for

Bolt.

Attribute used to identify a class as a test fixture:

TestFixture - NUnit.Framework.TestFixtureAttribute

Attributes used to tag methods withing a fixture to be run before/after the tests are executed:

TestFixtureSetUp - NUnit.Framework.TestFixtureSetUpAttribute

TestFixtureTearDown - NUnit.Framework.TestFixtureTearDownAttribute

Attributes used to for code run before/after each test:

SetUp - NUnit.Framework.SetUpAttribute

TearDown - NUnit.Framework.TearDownAttribute

Attribute descriptors used to define a test method:

Test - NUnit.Framework.TestAttribute

Description - NUnit.Framework.DescriptionAttribute

Attribute used to test for a specific exception to occur:

ExpectedException - NUnit.Framework.ExpectedExceptionAttribute

Attributes used to provide parameters to tests:

TestCase - NUnit.Framework.TestCaseAttribute

TestCaseSource - NUnit.Framework.TestCaseSourceAttribute

Values - NUnit.Framework.ValuesAttribute

ValueSource - NUnit.Framework.ValueSourceAttribute

Attributes used to manage the context of how a test is executed:

RequiresSTA - NUnit.Framework.RequiresSTAAttribute

RequiresMTA - NUnit.Framework.RequiresMTAAttribute

RequiresThread - NUnit.Framework.RequiresThreadAttribute

Attributes supported to manage which tests/methods are executed:

Ignore - NUnit.Framework.IgnoreAttribute

Explicit - NUnit.Framework.ExplicitAttribute

Category - NUnit.Framework.CategoryAttribute

Notable NUnit Attributes Not Supported by Bolt

Maxtime - NUnit.Framework.MaxtimeAttribute

Timeout - NUnit.Framework.TimeoutAttribute

SetupFixture - NUnit.Framework.SetupFixtureAttribute

OneTimeSetup - NUnit.Framework.OneTimeSetupAttribute

OneTimeTeardown - NUnit.Framework.OneTimeTeardownAttribute

Assembly Level Attributes - none supported

If you still need technical assistance, we can help:

Submit A Support Ticket