Enhanced C#
Language of your choice: library documentation
Properties | List of all members
Loyc.MiniTest.TestAttribute Class Reference

Identifies a method that contains a unit test, or that returns other tests or test fixtures. More...


Source file:
Inheritance diagram for Loyc.MiniTest.TestAttribute:
Loyc.MiniTest.BenchmarkAttribute

Remarks

Identifies a method that contains a unit test, or that returns other tests or test fixtures.

In addition to standard tests (which return void), the MiniTest runner is planned to support [Test] methods with other return values:

These features give the MiniTest runner powerful capabilities while keeping it simple. However, please note that NUnit doesn't offer this feature.

MiniTest allows tests to be static methods if they are inside a test fixture. However, when test objects are returned from a [Test] method, they are not scanned for static methods.

If multiple tests return the same test fixture instance, directly or indirectly, MiniTest runner will avoid running the test fixture instance multiple times, but it can show the results at multiple places in the result tree, which can be used to construct multiple "views" of the test results. However, if a test fixture is nested within itself, the nested instance is excluded from the result tree.

If a TestFixture class contains only a single "test suite" method (a method that returns tests), MiniTest merges that method with the class in the tree view. For example, if the class "MyTests" has a single method "GetTests", the tree view will use one line for "MyTests.GetTests" rather than separating out GetTests as a child of MyTests.

[Test] public void MyTest() {...}

Properties

string Description [get, set]
 Descriptive text for this test More...
 
bool AllowParallel [get, set]
 Indicates whether this test can be run in parallel with other tests in different test fixtures. More...
 
int MaxParallelThreads [get, set]
 
object Fails [get, set]
 Setting this property is used to indicate that the test is known to fail. It is used to mark tests that should be fixed eventually, but will not be fixed immediately. More...
 

Property Documentation

bool Loyc.MiniTest.TestAttribute.AllowParallel
getset

Indicates whether this test can be run in parallel with other tests in different test fixtures.

This property does not exist in NUnit.

string Loyc.MiniTest.TestAttribute.Description
getset

Descriptive text for this test

object Loyc.MiniTest.TestAttribute.Fails
getset

Setting this property is used to indicate that the test is known to fail. It is used to mark tests that should be fixed eventually, but will not be fixed immediately.

If you are new to a codebase, it helps to be able to tell the difference between new problems that need to be investigated and addressed immediately, and old problems that have been placed on the backburner to be fixed "someday", or feature requests that have not yet been addressed. Setting this property suggests that a failure may be low-priority and may be an old issue.

Referenced by Loyc.MiniTest.RunTests.Run().