コード例 #1
0
 /// <summary>
 /// Default constructor - initializes all fields to default values
 /// </summary>
 public RunPipeResultEventArgs(RunPipe pipe, ReportRun result)
     : base(pipe)
 {
     if (result==null)
         throw new ArgumentNullException("result");
     this.result = result;
 }
コード例 #2
0
ファイル: ReportVisitor.cs プロジェクト: timonela/mb-unit
		public virtual void VisitRun(ReportRun run)
		{
			foreach(ReportInvoker invoker in run.Invokers)
				this.VisitInvoker(invoker);

			if (run.Exception!=null)
				this.VisitException(run.Exception);
		}
コード例 #3
0
 public ReportRunEventArgs(ReportRun run)
 {
     if (run == null)
     {
         throw new ArgumentNullException("run");
     }
     this.run = run;
 }
コード例 #4
0
        public virtual void VisitRun(ReportRun run)
        {
            foreach (ReportInvoker invoker in run.Invokers)
            {
                this.VisitInvoker(invoker);
            }

            if (run.Exception != null)
            {
                this.VisitException(run.Exception);
            }
        }
コード例 #5
0
ファイル: Reportrun.cs プロジェクト: tmauldin/mb-unit
        public static ReportRun Skip(RunPipe pipe, Exception ex)
        {
            ReportRun run = new ReportRun();

            run.Result      = ReportRunResult.Skip;
            run.Name        = pipe.Name;
            run.Duration    = 0;
            run.Memory      = 0;
            run.AssertCount = MbUnit.Framework.Assert.AssertCount;
            run.Exception   = ReportException.FromException(ex);

            MbUnit.Framework.Assert.FlushWarnings(run);

            return(run);
        }
コード例 #6
0
ファイル: Reportrun.cs プロジェクト: timonela/mb-unit
        public static ReportRun Success(RunPipe pipe, ReportMonitor monitor)
        {
            ReportRun run = new ReportRun();
            run.ConsoleOut = monitor.Consoler.Out;
            run.ConsoleError = monitor.Consoler.Error;
            run.Result = ReportRunResult.Success;
            run.Name = pipe.Name;
            run.AssertCount = MbUnit.Framework.Assert.AssertCount;
            run.Duration = monitor.Timer.Duration;
            run.Memory = monitor.Memorizer.Usage;

            MbUnit.Framework.Assert.FlushWarnings(run);

            return run;
        }
コード例 #7
0
ファイル: Reportrun.cs プロジェクト: tmauldin/mb-unit
        public static ReportRun Ignore(RunPipe pipe, ReportMonitor monitor)
        {
            ReportRun run = new ReportRun();

            run.ConsoleOut   = monitor.Consoler.Out;
            run.ConsoleError = monitor.Consoler.Error;
            run.Result       = ReportRunResult.Ignore;
            run.Name         = pipe.Name;
            run.AssertCount  = MbUnit.Framework.Assert.AssertCount;
            run.Duration     = monitor.Timer.Duration;
            run.Memory       = monitor.Memorizer.Usage;

            MbUnit.Framework.Assert.FlushWarnings(run);

            return(run);
        }
コード例 #8
0
ファイル: Reportrun.cs プロジェクト: timonela/mb-unit
        public static ReportRun Failure(RunPipe pipe, ReportMonitor monitor, Exception ex)
        {
            ReportRun run = new ReportRun();
            run.ConsoleOut = monitor.Consoler.Out;
            run.ConsoleError = monitor.Consoler.Error;
            run.Result = ReportRunResult.Failure;
            run.Name = pipe.Name;
            run.AssertCount = MbUnit.Framework.Assert.AssertCount;
            run.Duration = monitor.Timer.Duration;
            run.Memory = monitor.Memorizer.Usage;
            run.Exception = ReportException.FromException(ex);

            MbUnit.Framework.Assert.FlushWarnings(run);

            return run;
        }
コード例 #9
0
        public void Failure(RunPipe pipe, ReportRun result)
        {
			this.OnChanged(pipe.Identifier,TestState.Failure);
		}
コード例 #10
0
ファイル: Assert.cs プロジェクト: BackupTheBerlios/mbunit-svn
 internal static void FlushWarnings(ReportRun run)
 {
     if (run != null)
     {
         foreach (ReportWarning warning in warnings)
             run.Warnings.AddReportWarning(warning);
     }
     warnings.Clear();
 }
コード例 #11
0
        void IRunPipeListener.Skip(RunPipe pipe, ReportRun result)
        {
            ReportFixture fixture = AddFixture(pipe.Fixture);

            fixture.Runs.AddReportRun(result);
        }
コード例 #12
0
        public void Ignore(RunPipe pipe, ReportRun result)
        {
			Writer.WriteLine("[ignored] {0}", pipe.Name);
		}
コード例 #13
0
        public void Run(Object fixture)
        {
            if (fixture == null)
                throw new ArgumentNullException("fixture");

            // create arguments...
            ArrayList args = new ArrayList();

            this.abortPending = false;
            this.monitor.Start();
            this.Start();

            Exception testException = null;
            foreach (RunInvokerVertex v in pipe.Invokers)
            {
                if (!v.HasInvoker)
                    continue;

                // if exception has already been throwed, execute non test only
                if (testException != null)
                {
                    if (!v.Invoker.Generator.IsTest)
                    {
                        // we execute tear down code and drop exceptions
                        try
                        {
                            v.Invoker.Execute(fixture, args);
                        }
                        catch (Exception)
                        { }
                    }
                }
                else
                {
                    try
                    {
                        if (this.IsAbortPending)
                            continue;
                        v.Invoker.Execute(fixture, args);
                    }
                    catch (Exception ex)
                    {
                        testException = ex;
                    }
                }
            }

            this.monitor.Stop();

            // success
            if (testException == null)
            {
                this.result = ReportRun.Success(this.pipe,this.monitor);
                this.Success();
            }
            else
            {
                // get rid of TargetInvocationException
                if (testException.GetType() == typeof(TargetInvocationException))
                    testException = testException.InnerException;

                // check if ignoreexception
                if (testException is IgnoreRunException)
                {
                    this.result = ReportRun.Ignore(this.pipe,this.monitor);
                    this.Ignore();
                }
                // failure
                else
                {
                    this.result = ReportRun.Failure(this.pipe,this.monitor,testException);
                    this.Failure();
                }
            }
        }
コード例 #14
0
ファイル: MbUnitTestRunner.cs プロジェクト: timonela/mb-unit
        void TestEngineFailure(ReportRun run)
        {
            this.failureCount++;

            TestResult summary = new TestResult();
            summary.State = TDF.TestState.Failed;
            summary.TotalTests = this.testCount;
            summary.Name = run.Name;
            summary.TimeSpan = new TimeSpan(0, 0, 0, 0, (int)(run.Duration * 1000));

            if (run.Exception != null)
            {
                ReportException ex = run.Exception;

                summary.Message = run.Exception.Message;
                summary.StackTrace = ex.ToString();
            }

            testListener.WriteLine(String.Format("[failure] {0}", run.Name), Category.Info);
            this.testListener.TestFinished(summary);
        }
コード例 #15
0
 public void ClearResult()
 {
     this.result = null;
     this.abortPending = false;
 }
コード例 #16
0
 public void Skip(RunPipe pipe, ReportRun result)
 { }
コード例 #17
0
        public void Failure(RunPipe pipe, ReportRun result)
        {
			Writer.WriteLine("[failure] {0}: {1}", pipe.Name, result.Exception.Message);
		}
コード例 #18
0
 public override void VisitRun(ReportRun run)
 {
     this.explorer.runByNames[run.Name] = run;
     base.VisitRun(run);
 }
コード例 #19
0
 public override void VisitRun(ReportRun run)
 {
     this.explorer.runByNames[run.Name]=run;
     base.VisitRun(run);
 }
コード例 #20
0
 public ReportRunEventArgs(ReportRun run)
 {
     if (run == null)
         throw new ArgumentNullException("run");
     this.run = run;
 }
コード例 #21
0
        public void Ignore(RunPipe pipe, ReportRun result)
        {
			this.OnChanged(pipe.Identifier,TestState.Ignored);
		}
コード例 #22
0
ファイル: MbUnitTestRunner.cs プロジェクト: timonela/mb-unit
        void TestEngineIgnore(ReportRun run)
        {
            this.ignoreCount++;

            TestResult summary = new TestResult();
            summary.State = TDF.TestState.Ignored;
            summary.TotalTests = this.testCount;
            summary.Name = run.Name;
            summary.TimeSpan = new TimeSpan(0, 0, 0, 0, (int)(run.Duration * 1000));

            testListener.WriteLine(String.Format("[ignored] {0}", run.Name), Category.Info);
            this.testListener.TestFinished(summary);
        }
コード例 #23
0
 public void Skip(RunPipe pipe, ReportRun result)
 {
     this.OnChanged(pipe.Identifier, TestState.Skip);
 }
コード例 #24
0
 void IRunPipeListener.Success(RunPipe pipe, ReportRun result)
 {
     ReportFixture fixture = AddFixture(pipe.Fixture);
     fixture.Runs.AddReportRun(result);
 }
コード例 #25
0
        public void Fail(ReportMonitor monitor,Exception ex)
        {
            if (monitor == null)
                throw new ArgumentNullException("monitor");
            if (ex == null)
                throw new ArgumentNullException("ex");

            this.Start();
            this.result = ReportRun.Failure(this.Pipe, monitor, ex);
            this.Failure();
        }
コード例 #26
0
 /// <summary />
 /// <remarks />
 public bool ContainsReportRun(ReportRun o)
 {
     return(this.List.Contains(o));
 }
コード例 #27
0
        public void Skip(Exception ex)
        {
            if (ex == null)
                throw new ArgumentNullException("ex");

            this.Start();
            this.result = ReportRun.Skip(this.Pipe, ex);
            this.Skip();
        }
コード例 #28
0
ファイル: Reportrun.cs プロジェクト: timonela/mb-unit
        public static ReportRun Skip(RunPipe pipe, Exception ex)
        {
            ReportRun run = new ReportRun();
            run.Result = ReportRunResult.Skip;
            run.Name = pipe.Name;
            run.Duration = 0;
            run.Memory = 0;
            run.AssertCount = MbUnit.Framework.Assert.AssertCount;
            run.Exception = ReportException.FromException(ex);

            MbUnit.Framework.Assert.FlushWarnings(run);

            return run;
        }
コード例 #29
0
ファイル: MbUnitTestRunner.cs プロジェクト: timonela/mb-unit
        void TestEngineSkip(ReportRun run)
        {
            this.skipCount++;

            TestResult summary = new TestResult();
            summary.State = TDF.TestState.Ignored;
            summary.TotalTests = this.testCount;
            summary.Name = run.Name;
            summary.TimeSpan = new TimeSpan(0, 0, 0, 0, 0);

            if (run.Exception != null)
            {
                ReportException ex = run.Exception;

                summary.Message = run.Exception.Message;
                summary.StackTrace = ex.ToString();
            }

            testListener.WriteLine(String.Format("[skipped] {0}", run.Name), Category.Info);
            this.testListener.TestFinished(summary);
        }
コード例 #30
0
ファイル: Reportfixture.cs プロジェクト: timonela/mb-unit
 /// <summary />
 /// <remarks />
 public void AddReportRun(ReportRun o) {
     this.List.Add(o);
 }
コード例 #31
0
ファイル: Reportfixture.cs プロジェクト: timonela/mb-unit
 /// <summary />
 /// <remarks />
 public bool ContainsReportRun(ReportRun o) {
     return this.List.Contains(o);
 }
コード例 #32
0
ファイル: Reportfixture.cs プロジェクト: timonela/mb-unit
 /// <summary />
 /// <remarks />
 public void RemoveReportRun(ReportRun o) {
     this.List.Remove(o);
 }
コード例 #33
0
 /// <summary />
 /// <remarks />
 public void AddReportRun(ReportRun o)
 {
     this.List.Add(o);
 }
コード例 #34
0
ファイル: DoxReport.cs プロジェクト: timonela/mb-unit
			public override void VisitRun(ReportRun run)
			{
				string pretty = dox.Pretifier.PretifyTest(run.Name);
				writer.WriteLine("{0}  - {1}",this.tab,pretty);
				base.VisitRun (run);
			}
コード例 #35
0
 /// <summary />
 /// <remarks />
 public void RemoveReportRun(ReportRun o)
 {
     this.List.Remove(o);
 }
コード例 #36
0
 // MLS 12/21/05 - changing some of the messages below to give details more like the AutoRunner,
 //      although it still doesn't show all the details that the AutoRunner does.
 // TOOD: Refactor so that this is exactly like the AutoRunner, and remove duplicate code.
 
 public void Success(RunPipe pipe, ReportRun result)
 {
     Writer.WriteLine("[success] {0}", pipe.Name);
 }