This project is read-only.
To implement, simply reference the ObviousCode.TestRunner dll and call test classes as below:

Tests can be run using the Tester.RunTestsInClass<T>. The class T should be decorated with the TestFixtureAttribute, and will recognise the following attributes:
  • TestFixtureAttribute
  • TestFixtureSetUpAttribute
  • TestFixtureTearDownAttribute
  • SetUpAttribute
  • TearDownAttribute
  • TestAttribute
  • ExpectedExceptionAttribute (as well as the ExpectedException type and message parameters)

Console example of using NHarness TestRunner

   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);

            foreach (TestResult result in results)
                Console.WriteLine("Test {0}: {1} {2}",
                                            result.Result == TestResult.Outcome.Fail ? "\r\n" + result.Message : "");


Last edited Nov 10, 2011 at 9:05 AM by obviouscode, version 2


No comments yet.