} // TestPerformance // ---------------------------------------------------------------------- private static bool TestPackage(string packageName) { bool success = true; SimpleTestRunner runner = new SimpleTestRunner(); TestPackage package = new TestPackage(packageName); if (runner.Load(package)) { TestResult result = runner.Run(new NullListener()); if (result.IsSuccess) { Console.WriteLine("tests finished successfully"); } else { success = false; TestResultReport testReport = new TestResultReport(result); foreach (string failedTest in testReport.FailedTests) { Console.WriteLine("failed test: {0}", failedTest); } foreach (string errorTests in testReport.ErrorTests) { Console.WriteLine("error test: {0}", errorTests); } } } return(success); } // TestPackage
// ---------------------------------------------------------------------- private static bool TestPackage( string packageName ) { bool success = true; SimpleTestRunner runner = new SimpleTestRunner(); TestPackage package = new TestPackage( packageName ); if ( runner.Load( package ) ) { TestResult result = runner.Run( new NullListener() ); if ( result.IsSuccess ) { Console.WriteLine( "tests finished successfully" ); } else { success = false; TestResultReport testReport = new TestResultReport( result ); foreach ( string failedTest in testReport.FailedTests ) { Console.WriteLine( "failed test: {0}", failedTest ); } foreach ( string errorTests in testReport.ErrorTests ) { Console.WriteLine( "error test: {0}", errorTests ); } } } return success; }