Esempio n. 1
0
        public TestRunState Run(ITestListener testListener, string assemblyFile, string cref)
        {
            if (testListener == null)
            {
                throw new ArgumentNullException("testListener");
            }
            if (assemblyFile == null)
            {
                throw new ArgumentNullException("assemblyFile");
            }

            FacadeOptions      options = FacadeOptions.ReadFromRegistry();
            FacadeTestRunState result  = TestRunner.Run(new AdapterFacadeTestListener(testListener), assemblyFile, cref, options);

            return(FacadeUtils.ToTestRunState(result));
        }
Esempio n. 2
0
        public TestRunState RunAssembly(ITestListener testListener, Assembly assembly)
        {
            if (testListener == null)
            {
                throw new ArgumentNullException("testListener");
            }
            if (assembly == null)
            {
                throw new ArgumentNullException("assembly");
            }

            FacadeOptions      options = FacadeOptions.ReadFromRegistry();
            FacadeTestRunState result  = TestRunner.Run(new AdapterFacadeTestListener(testListener),
                                                        GetAssemblyPath(assembly), null, options);

            return(FacadeUtils.ToTestRunState(result));
        }
Esempio n. 3
0
        public void RunReturnsCorrectResultCode(int resultCode, FacadeTestRunState expectedRunState)
        {
            StubbedLocalTestRunner tr = new StubbedLocalTestRunner();

            Assembly assembly     = typeof(TDNetAddInTests).Assembly;
            string   assemblyPath = AssemblyUtils.GetAssemblyLocalPath(assembly);

            tr.SetRunLauncherAction(delegate
            {
                TestLauncherResult result = new TestLauncherResult(new Report());
                result.SetResultCode(resultCode);
                return(result);
            });

            FacadeOptions      facadeOptions = new FacadeOptions();
            FacadeTestRunState runResult     = tr.Run(MockRepository.GenerateStub <IFacadeTestListener>(), assemblyPath, null, facadeOptions);

            Assert.AreEqual(expectedRunState, runResult);
        }
Esempio n. 4
0
        public static TestRunState ToTestRunState(FacadeTestRunState state)
        {
            switch (state)
            {
            case FacadeTestRunState.Success:
                return(TestRunState.Success);

            case FacadeTestRunState.Failure:
                return(TestRunState.Failure);

            case FacadeTestRunState.Error:
                return(TestRunState.Error);

            case FacadeTestRunState.NoTests:
                return(TestRunState.NoTests);

            default:
                throw new ArgumentOutOfRangeException("state");
            }
        }
Esempio n. 5
0
        public void RunReturnsCorrectResultCode(int resultCode, FacadeTestRunState expectedRunState)
        {
            StubbedLocalTestRunner tr = new StubbedLocalTestRunner();

            Assembly assembly = typeof(TDNetAddInTests).Assembly;
            string assemblyPath = AssemblyUtils.GetAssemblyLocalPath(assembly);
            tr.SetRunLauncherAction(delegate
            {
                TestLauncherResult result = new TestLauncherResult(new Report());
                result.SetResultCode(resultCode);
                return result;
            });

            FacadeOptions facadeOptions = new FacadeOptions();
            FacadeTestRunState runResult = tr.Run(MockRepository.GenerateStub<IFacadeTestListener>(), assemblyPath, null, facadeOptions);
            Assert.AreEqual(expectedRunState, runResult);
        }
Esempio n. 6
0
        public static TestRunState ToTestRunState(FacadeTestRunState state)
        {
            switch (state)
            {
                case FacadeTestRunState.Success:
                    return TestRunState.Success;

                case FacadeTestRunState.Failure:
                    return TestRunState.Failure;

                case FacadeTestRunState.Error:
                    return TestRunState.Error;

                case FacadeTestRunState.NoTests:
                    return TestRunState.NoTests;

                default:
                    throw new ArgumentOutOfRangeException("state");
            }
        }