Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            IsolationDispatcher.IsRootAppDomainOfIsolatedProcess = true;

            bool   attachDebugger            = bool.Parse(args[0]);
            string testAssemblyFullName      = args[1];
            string typeAssemblyQualifiedName = args[2];
            string testMethodName            = args[3];

            var testMethodInformation = new TestMethodInformation(testAssemblyFullName, typeAssemblyQualifiedName, testMethodName, attachDebugger);

            if (testMethodInformation.AttachDebugger)
            {
                Debugger.Launch();
            }

            // remark: no need to close the appdomain, as we close the process
            AppDomainRunner.Run(testMethodInformation, false);
        }
Exemplo n.º 2
0
        public static void IsolateTestRun(Isolations isolation, TestMethodInformation testMethodInformation)
        {
            if (IsInIsolatedAppDomain)
            {
                return;
            }

            switch (isolation)
            {
            case Isolations.AppDomain:
                AppDomainRunner.Run(testMethodInformation, true);
                break;

            case Isolations.Process:
                ProcessRunner.Run(testMethodInformation);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            Assert.Pass();
        }