コード例 #1
0
		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);
		}
コード例 #2
0
		public void FailIfEqual (TestCase testCase, object expected, object actual)
		{
			FailIfEqual (testCase, null, expected, actual);
		}
コード例 #3
0
		public void WarnIfNot (TestCase testCase, bool condition)
		{
			WarnIf (testCase, !condition);
		}
コード例 #4
0
		public void FailIfNot (TestCase testCase, bool condition)
		{
			FailIf (testCase, !condition);
		}
コード例 #5
0
		public void WarnIf (TestCase testCase, bool condition)
		{
			WarnIf (testCase, null, condition);
		}
コード例 #6
0
		public void Fail (TestCase testCase, string message)
		{
			AddFailure (testCase, new TestFailedException (message));
		}
コード例 #7
0
		protected virtual void AddError (TestCase testCase, Exception e)
		{
			if (testResult != null)
			{
				testResult.StatusNotify (testCase, new TestStatus (TestStatusCode.Error, e));
			}
			hasErrors = true;
		}
コード例 #8
0
		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);
		}
コード例 #38
0
		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;
		}
コード例 #40
0
		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));
 }