Exemplo n.º 1
0
        void BuildTestSuiteProjectNodes(string testRunTime, TestResults results, MSpec mspecResults)
        {
            foreach (var assembly in mspecResults.Assembly)
            {
                var assemblySuite = new TestSuite();
                assemblySuite.TestSuiteType = "Project";
                assemblySuite.Executed = true;
                assemblySuite.Time = testRunTime;

                assemblySuite.Asserts = GetAssemblySpecificationCount(assembly);

                assemblySuite.Name = Path.Combine(Path.GetDirectoryName(mspecResults.Assembly[0].Location), mspecResults.Assembly[0].Name);

                if (GetAssemblySpecificationFailures(assembly) == 0 )
                {
                    assemblySuite.Result = "Success";
                    assemblySuite.Success = true;
                }
                else
                {
                    assemblySuite.Result = "Failure";
                    assemblySuite.Success = false;
                }

                var assemblyResults = new Results();
                assemblySuite.Results = assemblyResults;

                BuildTestSuiteNameSpaceNodes(testRunTime, assemblyResults, assembly);

                results.TestSuite = assemblySuite;
            }
        }
Exemplo n.º 2
0
        void BuildTestSuiteTestFixtureNodes(string testRunTime, Results concernResults, Concern concern)
        {
            foreach (var context in concern.Context)
            {
                var contextSuite = new TestSuite {TestSuiteType = "TestFixture", Name = concern.Name, Executed = true};

                if (GetContextSpecificationFailures(context) == 0)
                {
                    contextSuite.Result = "Success";
                    contextSuite.Success = true;
                }
                else
                {
                    contextSuite.Result = "Failure";
                    contextSuite.Success = false;
                }

                contextSuite.Time = testRunTime;

                var contextResults = new Results();
                contextSuite.Results = contextResults;
                concernResults.TestSuite = contextSuite;

                BuildTestCaseNodes(testRunTime, contextResults, context);
            }
        }
Exemplo n.º 3
0
        void BuildTestSuiteNameSpaceNodes(string testRunTime, Results assemblyResults, Assembly assembly)
        {
            foreach (var concern in assembly.Concern)
            {

                var concernSuite = new TestSuite {TestSuiteType = "NameSpace", Name = concern.Name, Executed = true};

                if (GetConsernSpecificationFailures(concern) == 0)
                {
                    concernSuite.Result = "Success";
                    concernSuite.Success = true;
                }
                else
                {
                    concernSuite.Result = "Failure";
                    concernSuite.Success = false;
                }

                concernSuite.Time = testRunTime;

                assemblyResults.TestSuite = concernSuite;

                var concernResults = new Results();
                concernSuite.Results = concernResults;

                BuildTestSuiteTestFixtureNodes(testRunTime, concernResults, concern);
            }
        }