예제 #1
0
 int GetTotalSpecificationCount(MSpec mspecResults)
 {
     return
         mspecResults.Assembly.Sum(
             assemblies =>
             assemblies.Concern.Sum(
                 concerns =>
                 concerns.Context.Sum(
                     context =>
                     (from spec in context.Specification select spec).Count())));
 }
예제 #2
0
 int GetTotalNotImplemented(MSpec mspecResults)
 {
     return mspecResults.Assembly.Sum(
         assemblies =>
         assemblies.Concern.Sum(
             concerns =>
             concerns.Context.Sum(
                 context =>
                 (from spec in context.Specification where spec.Status == "not-implemented" select spec).Count())));
 }
예제 #3
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;
            }
        }
예제 #4
0
 int GetTotalFailures(MSpec mspecResults)
 {
     return mspecResults.Assembly.Sum(
         assembly => assembly.Concern.Sum(concern => GetConsernSpecificationFailures(concern)));
 }
예제 #5
0
        static string FormatTestRunTime(MSpec mspecResults)
        {
            int milliseconds;
            int.TryParse(mspecResults.Run.Time, out milliseconds);
            var ts = new TimeSpan(0,0,0,0,milliseconds);
            string testRunTime = string.Format("{0}.{1}", ts.Seconds,ts.Milliseconds);

            return testRunTime;
        }