コード例 #1
0
 public ReportCounter GetCounter()
 {
     ReportCounter counter = new ReportCounter();
     foreach(Fixture fixture in this)
         counter.AddCounts(fixture.GetCounter());
     return counter;
 }
コード例 #2
0
ファイル: ReportCounter.cs プロジェクト: timonela/mb-unit
		public void AddCounts(ReportCounter right)
		{
			if (right==null)
				throw new ArgumentNullException("right");
			this.RunCount += right.RunCount;
			this.SuccessCount += right.SuccessCount;
			this.FailureCount += right.FailureCount;
			this.IgnoreCount += right.IgnoreCount;
            this.SkipCount += right.SkipCount;
            this.AssertCount += right.AssertCount;
            this.Duration += right.Duration;
        }
コード例 #3
0
 public void AddCounts(ReportCounter right)
 {
     if (right == null)
     {
         throw new ArgumentNullException("right");
     }
     this.RunCount     += right.RunCount;
     this.SuccessCount += right.SuccessCount;
     this.FailureCount += right.FailureCount;
     this.IgnoreCount  += right.IgnoreCount;
     this.SkipCount    += right.SkipCount;
     this.AssertCount  += right.AssertCount;
     this.Duration     += right.Duration;
 }
コード例 #4
0
ファイル: Fixture.cs プロジェクト: timonela/mb-unit
 public ReportCounter GetCounter()
 {
     ReportCounter counter = new ReportCounter();
     counter.RunCount = this.Starters.Count;
     foreach (RunPipeStarter starter in this.Starters)
     {
         if (starter.HasResult)
         {
             switch (starter.Result.Result)
             {
                 case ReportRunResult.Success:
                     ++counter.SuccessCount;
                     break;
                 case ReportRunResult.Failure:
                     ++counter.FailureCount;
                     break;
                 case ReportRunResult.Ignore:
                     ++counter.IgnoreCount;
                     break;
             }
         }
     }
     return counter;
 }
コード例 #5
0
        public void LoadAndRunFixtures()
        {
            this.CreateAssembly();

            // load assembly
            using(TestDomain domain = new TestDomain(this.compiler.Parameters.OutputAssembly))
            {
                domain.ShadowCopyFiles = false;
                domain.InitializeEngine();
                foreach (string dir in this.Compiler.Parameters.ReferencedAssemblies)
                    domain.TestEngine.AddHintDirectory(dir);
                domain.PopulateEngine();
                Console.WriteLine("Domain loaded");
                Console.WriteLine("Tree populated, {0} tests", domain.TestEngine.GetTestCount());
                // Assert.AreEqual(1, domain.TestTree.GetTestCount());
                // domain.TestTree.Success+=new MbUnit.Core.RunSuccessEventHandler(TestTree_Success);
                // running tests
                domain.TestEngine.RunPipes();

                // display report
                TextReport report = new TextReport();
                result = domain.TestEngine.Report.Result;
                report.Render(result,Console.Out);
                counter = domain.TestEngine.GetTestCount();
            }
        }
コード例 #6
0
 public ReportCounter GetTestCount()
 {
     ReportCounter count = new ReportCounter();;
     foreach(TreeTestDomain domain in this.list)
     {
         if (domain.TestEngine == null)
             continue;
         count.AddCounts(domain.TestEngine.GetTestCount());
     }
     return count;
 }
コード例 #7
0
 public ReportCounter GetCounter()
 {
     ReportCounter counter = new ReportCounter();
     foreach (FixtureVertex v in this.graph.Vertices)
     {
         counter.AddCounts(v.Fixtures.GetCounter());
     }
     return counter;
 }
コード例 #8
0
 public void ResetTests()
 {
     this.Counter.Clear();
     if (this.tree!=null)
     {
         this.counter = this.Tree.TestDomains.GetTestCount();
     }
 }