Enhanced C#
Language of your choice: library documentation
Static Public Member Functions | List of all members
Loyc.MiniTest.RunTests Class Reference

Searches for test methods and runs them, printing the name of each test to the console followed by errors (if any) produced by the test. More...


Source file:

Remarks

Searches for test methods and runs them, printing the name of each test to the console followed by errors (if any) produced by the test.

This class finds tests by looking for custom attributes by their string name (e.g. "TestAttribute"), so it is compatible with both NUnit.Framework and Loyc.MiniTest.

RunTests is a stripped-down subset of the functionality supported by MiniTestRunner.

Static Public Member Functions

static int Run (object o)
 Runs all test methods on the given object (public methods that have a TestAttribute). More...
 
static int RunMany (params object[] os)
 Runs all tests in an array of test objects. More...
 

Member Function Documentation

◆ Run()

static int Loyc.MiniTest.RunTests.Run ( object  o)
inlinestatic

Runs all test methods on the given object (public methods that have a TestAttribute).

Returns
The number of tests that failed unexpectedly (where the TestAttribute.Fails property is unset).

References Loyc.MiniTest.TestAttribute.Fails.

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

◆ RunMany()

static int Loyc.MiniTest.RunTests.RunMany ( params object[]  os)
inlinestatic

Runs all tests in an array of test objects.

Returns
The total number of tests that unexpectedly failed.

References Loyc.MiniTest.RunTests.Run().