public void RunAllTests()
        {
            var ta = new TestArguments(new[] { string.Format("assembly={0}", _testAssembly), "newDomain=true" });

            // Get tests
            var assembly = Assembly.LoadFrom(ta.AssemblyLocation);
            var filteredTests = new List<MethodInfo>(AssemblyParser.GetTestMethods(assembly));

            var tests = filteredTests.Select(test => string.Format("{0}.{1}", test.ReflectedType.FullName, test.Name)).ToList();

            // Run tests
            var sw = Stopwatch.StartNew();
            TestResult result = new Runner.TestRunner().RunTestsInParallel(tests, assembly, ta.NumberOfThreads);
            sw.Stop();

            var total = (from object r in result.Results select r as TestResult).Count();
            var failed = (from object r in result.Results select r as TestResult).Count(tr => tr.IsFailure || tr.IsError);
            var passed = (from object r in result.Results select r as TestResult).Count(tr => tr.IsSuccess);

            // Test should finish in under one minute
            Assert.IsTrue(sw.ElapsedMilliseconds / 1000 < 60);

            // 10 Tests were run
            Assert.IsTrue(total == 10);

            // 1 Failed
            Assert.IsTrue(failed == 1);

            // 9 Passed
            Assert.IsTrue(passed == 9);
        }
        public void RunCategoryTests()
        {
            var ta = new TestArguments(new[] { string.Format("assembly={0}", _testAssembly), "categories=A", "newDomain=true" });

            // Get tests
            var assembly = Assembly.LoadFrom(ta.AssemblyLocation);
            var allTests = AssemblyParser.GetTestMethods(assembly);
            var filteredTests = new List<MethodInfo>();

            foreach (var fixture in ta.Fixtures)
            {
                filteredTests.AddRange(AssemblyParser.FilterByFixture(allTests, fixture));
            }

            foreach (var category in ta.Categories)
            {
                filteredTests.AddRange(AssemblyParser.FilterByCategory(allTests, category));
            }

            var tests = filteredTests.Select(test => string.Format("{0}.{1}", test.ReflectedType.FullName, test.Name)).ToList();

            // Run tests
            TestResult result = new Runner.TestRunner().RunTestsInParallel(tests, assembly, ta.NumberOfThreads);

            var total = (from object r in result.Results select r as TestResult).Count();
            var failed = (from object r in result.Results select r as TestResult).Count(tr => tr.IsFailure || tr.IsError);
            var passed = (from object r in result.Results select r as TestResult).Count(tr => tr.IsSuccess);

            // 1 Test was run
            Assert.IsTrue(total == 1);

            // 1 Failed
            Assert.IsTrue(failed == 1);

            // 0 Passed
            Assert.IsTrue(passed == 0);
        }
        public void RunMinuteLongTest()
        {
            var ta = new TestArguments(new[] { string.Format("assembly={0}", _testAssembly), "fixtures=OneMinute", "newDomain=true" });

            // Get tests
            var assembly = Assembly.LoadFrom(ta.AssemblyLocation);
            var allTests = AssemblyParser.GetTestMethods(assembly);
            var filteredTests = new List<MethodInfo>();

            foreach (var fixture in ta.Fixtures)
            {
                filteredTests.AddRange(AssemblyParser.FilterByFixture(allTests, fixture));
            }

            foreach (var category in ta.Categories)
            {
                filteredTests.AddRange(AssemblyParser.FilterByCategory(allTests, category));
            }

            var tests = filteredTests.Select(test => string.Format("{0}.{1}", test.ReflectedType.FullName, test.Name)).ToList();

            // Run tests
            var sw = Stopwatch.StartNew();
            TestResult result = new Runner.TestRunner().RunTestsInParallel(tests, assembly, ta.NumberOfThreads);
            sw.Stop();

            var total = (from object r in result.Results select r as TestResult).Count();
            var failed = (from object r in result.Results select r as TestResult).Count(tr => tr.IsFailure || tr.IsError);
            var passed = (from object r in result.Results select r as TestResult).Count(tr => tr.IsSuccess);

            // Test should finish in under one minute
            Assert.IsTrue(sw.ElapsedMilliseconds / 1000 < 60);

            // 6 Tests were run
            Assert.IsTrue(total == 6);

            // 0 Failed
            Assert.IsTrue(failed == 0);

            // 6 Passed
            Assert.IsTrue(passed == 6);
        }