예제 #1
0
        private TestResult RunTestsInAssemblies(IList assemblies, ITestFilter testfilter)
        {
            // Note: in order for nunit to unload assembly (not lock it)
            // we are using a modified version of nunit.core.dll (and the dependent nunit.interfaces.dll)
            // if the nunit dlls are updated this is what needs to be changed:
            //      in TestAssemblyBuilder class in Load method,
            //      change "assembly = Assembly.Load(assemblyName);"
            //      to "assembly = Assembly.Load(File.ReadAllBytes(path));"
            TestPackage theTestPackage = new TestPackage("All Dlls", assemblies);

            theTestPackage.Settings.Add("UseThreadedRunner", false);
            theTestPackage.Settings.Add("DomainUsage", DomainUsage.None);
            RemoteTestRunner testRunner = new RemoteTestRunner();

            testRunner.Load(theTestPackage);
            TestResult testResult = testRunner.Run(NullListener.NULL, testfilter, false, LoggingThreshold.Off);

            // Dispose
            testRunner.Unload();
            testRunner.Dispose();
            return(testResult);
        }
 public void Dispose()
 {
     runner.Dispose();
     AppDomain.Unload(domain);
 }
 public void Dispose()
 {
     _remoteTestRunner.Dispose();
 }