public void RunTestsInAssemblyParallelTest() { IParallelTestRunner parallelRunner = new ParallelTestRunner(); Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); IList<ITestResult> results = parallelRunner.RunAllTestsInAssemblyParallel(); stopwatch.Stop(); Console.WriteLine("Time: " + stopwatch.Elapsed); foreach (ITestResult result in results) { Console.WriteLine("Fixture: " + result.MethodResult.ClassName); Console.WriteLine("Test: " + result.MethodResult.MethodName); if (result.MethodResult.Exception != null) Console.WriteLine("Test Exception: " + result.MethodResult.Exception); Console.WriteLine("Duration: " + result.TestDuration); Console.WriteLine("\n"); } }
public void RunTestsParallelTest() { IParallelTestRunner parallelRunner = new ParallelTestRunner(); ITestInfo testInfo = new TestInfo{ Class = "UserTests", Method = "GetUserTest" }; IList<ITestResult> results = parallelRunner.RunTestParallel(testInfo); foreach (ITestResult result in results) { if (result.MethodResult.Exception != null) Console.WriteLine(result.MethodResult.Exception.StackTrace); Console.WriteLine(result.MethodResult.ClassName); Console.WriteLine(result.MethodResult.MethodName); Console.WriteLine(result.TestDuration); } }
public void RunTestsInClassParallelTest() { IParallelTestRunner parallelRunner = new ParallelTestRunner(); Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); IList<ITestResult> results = parallelRunner.RunTestsInClassParallel("UserTests"); stopwatch.Stop(); Console.WriteLine("Time: " + stopwatch.Elapsed); foreach (ITestResult result in results) { if (result.MethodResult.Exception != null) Console.WriteLine(result.MethodResult.Exception); Assert.IsTrue(result.MethodResult.Exception == null); } }