public override void EndTest (TestCase testCase, TestCaseResult result)
		{
			if (result.HasSkipped ())
				Console.WriteLine ("SKIPPED: {0}", testCase.Name);
			else if (result.HasPassed ())
				Console.WriteLine ("PASSED: {0}", testCase.Name);
#if false
			else if (result.HasWarnings ())
				Console.WriteLine ("PASSED with warnings: {0}", testCase.Name);
#endif
			else
				Console.WriteLine ("***FAILED: {0}", testCase.Name);
		}
		public void FailIfEqual (TestCase testCase, object expected, object actual)
		{
			FailIfEqual (testCase, null, expected, actual);
		}
		public void WarnIfNot (TestCase testCase, bool condition)
		{
			WarnIf (testCase, !condition);
		}
		public void FailIfNot (TestCase testCase, bool condition)
		{
			FailIf (testCase, !condition);
		}
		public void WarnIf (TestCase testCase, bool condition)
		{
			WarnIf (testCase, null, condition);
		}
		public void Fail (TestCase testCase, string message)
		{
			AddFailure (testCase, new TestFailedException (message));
		}
		protected virtual void AddError (TestCase testCase, Exception e)
		{
			if (testResult != null)
			{
				testResult.StatusNotify (testCase, new TestStatus (TestStatusCode.Error, e));
			}
			hasErrors = true;
		}
		public void WarnIfNotSame (TestCase testCase, object expected, object actual)
		{
			WarnIfNotSame (testCase, null, expected, actual);
		}
示例#9
0
 public void WarnIfEqual(TestCase testCase, object expected, object actual)
 {
     WarnIfEqual(testCase, null, expected, actual);
 }
示例#10
0
 public void FailIfEqual(TestCase testCase, object expected, object actual)
 {
     FailIfEqual(testCase, null, expected, actual);
 }
示例#11
0
 public void WarnIfNot(TestCase testCase, string message, bool condition)
 {
     WarnIf(testCase, message, !condition);
 }
示例#12
0
 public void WarnIfNot(TestCase testCase, bool condition)
 {
     WarnIf(testCase, !condition);
 }
示例#13
0
 public void FailIfNot(TestCase testCase, string message, bool condition)
 {
     FailIf(testCase, message, !condition);
 }
示例#14
0
 public void FailIfNot(TestCase testCase, bool condition)
 {
     FailIf(testCase, !condition);
 }
示例#15
0
 public void WarnIf(TestCase testCase, bool condition)
 {
     WarnIf(testCase, null, condition);
 }
示例#16
0
		public void WarnIfEqual (TestCase testCase, object expected, object actual)
		{
			WarnIfEqual (testCase, null, expected, actual);
		}
示例#17
0
		public void FailIfSame (TestCase testCase, string message, object expected, object actual)
		{
			FailIf (testCase, ConcatMessages (message, "Expected the same reference value."), expected == actual);
		}
示例#18
0
 public void FailIfSame(TestCase testCase, string message, object expected, object actual)
 {
     FailIf(testCase, ConcatMessages(message, "Expected the same reference value."), expected == actual);
 }
示例#19
0
		public void RunCase (TestCase testCase)
		{
			try
			{
				testCase.RunCase (this);
			}
			catch (TestSkippedException e)
			{
				SkipTest (testCase, e);
			}
			catch (TestFailedException e)
			{
				AddFailure (testCase, e);
			}
			catch (Exception e)
			{
				AddError (testCase, e);
			}
		}
示例#20
0
 public void FailIfNotSame(TestCase testCase, object expected, object actual)
 {
     FailIfNotSame(testCase, null, expected, actual);
 }
示例#21
0
		protected virtual void AddWarning (TestCase testCase, TestFailedException e)
		{
			if (testResult != null)
			{
				testResult.StatusNotify (testCase, new TestStatus (TestStatusCode.Warning, e));
			}
			hasWarnings = true;
		}
示例#22
0
 public void WarnIfNotSame(TestCase testCase, object expected, object actual)
 {
     WarnIfNotSame(testCase, null, expected, actual);
 }
示例#23
0
 public void FailIf(TestCase testCase, bool condition)
 {
     FailIf(testCase, null, condition);
 }
示例#24
0
 public void WarnIfNotSame(TestCase testCase, string message, object expected, object actual)
 {
     WarnIf(testCase, ConcatMessages(message, "Expected the same reference value."), expected != actual);
 }
示例#25
0
		public void WarnIf (TestCase testCase, string message, bool condition)
		{
			if (condition)
				AddWarning (testCase, new TestFailedException (message));
		}
示例#26
0
 public void Fail(TestCase testCase)
 {
     Fail(testCase, null);
 }
示例#27
0
		public void FailIfNot (TestCase testCase, string message, bool condition)
		{
			FailIf (testCase, message, !condition);
		}
示例#28
0
 public void Fail(TestCase testCase, string message)
 {
     AddFailure(testCase, new TestFailedException(message));
 }
示例#29
0
		public void WarnIfNot (TestCase testCase, string message, bool condition)
		{
			WarnIf (testCase, message, !condition);
		}
示例#30
0
 public void Warn(TestCase testCase)
 {
     Warn(testCase, null);
 }
示例#31
0
		public void FailIfEqual (TestCase testCase, string message, object expected, object actual)
		{
			if (AreEqual (expected, actual))
				AddFailure (testCase, new ComparisonException (message, expected, actual));
		}
示例#32
0
		private void StartTest (TestCase testCase)
		{
			lock (listeners.SyncRoot)
			{
				runCount++;
				foreach (ITestListener listener in listeners)
				{
					listener.StartTest (testCase);
				}
			}
		}
示例#33
0
		public void WarnIfNotEqual (TestCase testCase, string message, object expected, object actual)
		{
			if (!AreEqual (expected, actual))
				AddWarning (testCase, new ComparisonException (message, expected, actual));
		}
示例#34
0
		private void EndTest (TestCase testCase, TestCaseResult testCaseResult)
		{
			lock (listeners.SyncRoot)
			{
				if (testCaseResult.HasPassed ())
				{
					passedCount++;
				}
				foreach (ITestListener listener in listeners)
				{
					listener.EndTest (testCase, testCaseResult);
				}
			}
		}
示例#35
0
		public void FailIfNotSame (TestCase testCase, object expected, object actual)
		{
			FailIfNotSame (testCase, null, expected, actual);
		}
示例#36
0
		public void StatusNotify (TestCase testCase, TestStatus status)
		{
			lock (listeners.SyncRoot)
			{
				switch (status.Code)
				{
				case TestStatusCode.Skipped:
					skippedCount++;
					break;
				case TestStatusCode.Warning:
					warningCount++;
					break;
				case TestStatusCode.Failure:
					failureCount++;
					break;
				case TestStatusCode.Error:
					errorCount++;
					break;
				}
				foreach (ITestListener listener in listeners)
				{
					listener.StatusNotify (testCase, status);
				}
			}
		}
示例#37
0
		public void WarnIfNotSame (TestCase testCase, string message, object expected, object actual)
		{
			WarnIf (testCase, ConcatMessages (message, "Expected the same reference value."), expected != actual);
		}
		public override void StartTest (TestCase testCase)
		{
			Console.WriteLine ("STARTED: {0}", testCase.Name);
		}
示例#39
0
		protected virtual void SkipTest (TestCase testCase, TestSkippedException e)
		{
			if (testResult != null)
			{
				testResult.StatusNotify (testCase, new TestStatus (TestStatusCode.Skipped, e.Message));
			}
			skipped = true;
		}
		public override void StatusNotify (TestCase testCase, TestStatus status)
		{
			Console.WriteLine ("{0}", status);
		}
示例#41
0
		protected virtual void AddFailure (TestCase testCase, TestFailedException e)
		{
			if (testResult != null)
			{
				testResult.StatusNotify (testCase, new TestStatus (TestStatusCode.Failure, e));
			}
			hasFailures = true;
		}
示例#42
0
		public void Warn (TestCase testCase, string message)
		{
			AddWarning (testCase, new TestFailedException (message));
		}
示例#43
0
		public void Fail (TestCase testCase)
		{
			Fail (testCase, null);
		}
示例#44
0
		public void FailIf (TestCase testCase, bool condition)
		{
			FailIf (testCase, null, condition);
		}
示例#45
0
		public void Warn (TestCase testCase)
		{
			Warn (testCase, null);
		}
示例#46
0
 public void Warn(TestCase testCase, string message)
 {
     AddWarning(testCase, new TestFailedException(message));
 }