Take a look at NHarness at codeplex, a very simple library that lets you run NUnit test instruments in a test project. This allows you to debug your unit tests if required.
Example (from the codeplex page) of a test runner below
public class RunTests { public static void Main(string[] args) { TestResults results = Tester.RunTestsInClass<Tests>(); Console.WriteLine("Tests Run: {0}", results.NumberOfResults); Console.WriteLine("Results {0}:PASSED {1}:FAILED", results.NumberOfPasses, results.NumberOfFails); Console.WriteLine("Details:"); foreach (TestResult result in results) { Console.WriteLine("Test {0}: {1} {2}", result.MethodName, result.Result, result.Result == TestResult.Outcome.Fail ? "\r\n" + result.Message : ""); } Console.ReadLine(); } }
The advantage of this library is that the TestResults class can be used to retrieve information about completed tests, so the library can also be used in custom unit test applications
johnc Dec 01 2018-11-12T00: 00Z
source share