Run() публичный Метод

public Run ( object fixture ) : IResultSummary
fixture object
Результат IResultSummary
        public bool DirectoryBasedExecuted(string baseInputDirectory)
        {
            if (m_InTestRun) return true;

            m_InTestRun = true;

            //work around for bug of NUnit GUI runner
            baseInputDirectory = baseInputDirectory +
                                 Path.DirectorySeparatorChar +
                                 ".." +
                                 Path.DirectorySeparatorChar +
                                 this.GetType().Assembly.GetName().Name;

            var specificationConfig = new SpecificationConfig().Load(this.GetType());
            specificationConfig.BaseInputDirectory = baseInputDirectory;
            var fixtureRunner = new FixtureRunner(specificationConfig);
            var testResult = fixtureRunner.Run(this);

            m_InTestRun = false;

            foreach (var failureDetail in testResult.FailureDetails) {
                Console.WriteLine(failureDetail.Message);
                Console.WriteLine(failureDetail.StackTrace);
            }
            foreach (var errorDetail in testResult.ErrorDetails)
            {
                Console.WriteLine(errorDetail.Message);
                Console.WriteLine(errorDetail.StackTrace);
                Console.WriteLine(errorDetail.Exception);
            }

            return !testResult.HasFailures && !testResult.HasExceptions;
        }
Пример #2
0
        public override TestResult Run(EventListener listener, ITestFilter filter)
        {
            listener.TestStarted(this.TestName);

            Fixture = Reflect.Construct(m_FixtureType);
            RunFixtureSetUp();
            var fixtureRunner = new FixtureRunner();
            var concordionResult = fixtureRunner.Run(Fixture);
            var testResult = NUnitTestResult(concordionResult, fixtureRunner.ResultPath);
            RunFixtureTearDown();

            listener.TestFinished(testResult);

            return testResult;
        }
        public bool EmbeddedExecuted()
        {
            if (m_InTestRun) return true;

            m_InTestRun = true;

            var specificationConfig = new SpecificationConfig().Load(this.GetType());
            specificationConfig.BaseInputDirectory = null;
            var fixtureRunner = new FixtureRunner(specificationConfig);
            var testResult = fixtureRunner.Run(this);

            m_InTestRun = false;

            return !testResult.HasFailures && !testResult.HasExceptions;
        }