Exemplo n.º 1
0
        private static void RunAllTests(Dictionary <string, TestAssembly> assemblies, Dictionary <string, TestClass> classes, Dictionary <string, TestDetails> tests)
        {
            var nunitTestFramework = new NUnitTestFramework(new ConsoleTestResultReporter());
            var msTestFramework    = new MsTestFramework(new ConsoleTestResultReporter());

            foreach (var testId in tests.Keys)
            {
                var test = tests[testId];

                var methodName        = test.MethodName;
                var className         = test.Class.ToString();
                var assemblyPath      = test.Class.Assembly.AssemblyPath;
                var assemblyHintPaths = test.Class.Assembly.HintPaths;

                BaseTestFramework framework = msTestFramework;
                if (test.TestFramework == TestFramework.NUnit)
                {
                    framework = nunitTestFramework;
                }

                TestRunner runner = new TestRunner(framework);
                runner.SetAssembly(assemblyPath, assemblyHintPaths);
                runner.SetClass(className);

                runner.AddTest(testId, methodName);

                runner.RunTestSuite();
            }
        }
Exemplo n.º 2
0
        public TestRunner(BaseTestFramework testFramework)
        {
            _testFramework = testFramework;

            AppDomain currentDomain = AppDomain.CurrentDomain;

            currentDomain.AssemblyResolve += new ResolveEventHandler(currentDomain_AssemblyResolve);

            TestsToRun = new Dictionary <string, string>();
        }