Exemplo n.º 1
0
		public override void RunAsync (TestListener listener)
		{
			this.listener = listener;
			
			OnStarted (null);
			listener.TestStarted (this);
			Result = new TestResult (this);

			queue = new Queue<AsyncTestCase> (Tests.Count);

			switch (RunState) {
			case RunState.NotRunnable:
				Result.Error (IgnoreReason);
				break;

			case RunState.Ignored:
				Result.NotRun (IgnoreReason);
				break;

			case RunState.Runnable:
				foreach (AsyncTestCase @case in Tests)
					queue.Enqueue (@case);
				break;
			}
		}
Exemplo n.º 2
0
		public void Update (TestResult result)
		{
			Result = result;
			
			Update ();
			
			if (GetContainerTableView () != null) {
				var root = GetImmediateRootElement ();
				root.Reload (this, UITableViewRowAnimation.Fade);
			}
		}
Exemplo n.º 3
0
		public override void RunAsync (TestListener listener)
		{
			this.listener = listener;

			queue = new Queue<AsyncTestFixture> (Tests.Count);
			Result = new TestResult (this);

			OnStarted (null);
			listener.TestStarted (this);

			foreach (AsyncTestFixture fixture in Tests)
				queue.Enqueue (fixture);

			RunIterate ();
		}
Exemplo n.º 4
0
 public void TestFinished(TestResult result) { }
Exemplo n.º 5
0
		public void TestFinished (TestResult result)
		{
			AndroidRunner.Results [result.Test.FullName ?? result.Test.Name] = result;
			
			if (result.Test is TestSuite) {
				if (!result.IsError && !result.IsFailure && !result.IsSuccess && !result.Executed)
					Writer.WriteLine ("\t[INFO] {0}", result.Message);
				
				var diff = DateTime.UtcNow - time.Pop ();
				Writer.WriteLine ("{0} : {1} ms", result.Test.Name, diff.TotalMilliseconds);
			} else {
				if (result.IsSuccess) {
					Writer.Write ("\t{0} ", result.Executed ? "[PASS]" : "[IGNORED]");
				} else if (result.IsFailure || result.IsError) {
					Writer.Write ("\t[FAIL] ");
				} else {
					Writer.Write ("\t[INFO] ");
				}
				Writer.Write (result.Test.Name);
				
				string message = result.Message;
				if (!String.IsNullOrEmpty (message)) {
					Writer.Write (" : {0}", message.Replace ("\r\n", "\\r\\n"));
				}
				Writer.WriteLine ();
						
				string stacktrace = result.StackTrace;
				if (!String.IsNullOrEmpty (result.StackTrace)) {
					string[] lines = stacktrace.Split (new char [] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
					foreach (string line in lines)
						Writer.WriteLine ("\t\t{0}", line);
				}
			}
		}
Exemplo n.º 6
0
		public void TestFinished (TestResult result)
		{
			TestSuite ts = result.Test as TestSuite;
			if (ts != null) {
				suite_elements [ts].Update (result);
			} else {
				TestCase tc = result.Test as TestCase;
				if (tc != null)
					case_elements [tc].Update (result);
			}
		}
Exemplo n.º 7
0
		public void TestFinished (TestResult result)
		{
			TestSuite ts = result.Test as TestSuite;
			if (ts != null) {
				suite_elements [ts].Update (result);
			} else {
				TestCase tc = result.Test as TestCase;
				if (tc != null)
					case_elements [tc].Update (result);
			}
			
			if (result.Test is TestSuite) {
				if (!result.IsError && !result.IsFailure && !result.IsSuccess && !result.Executed)
					Writer.WriteLine ("\t[INFO] {0}", result.Message);
				
				var diff = DateTime.UtcNow - time.Pop ();
				Writer.WriteLine ("{0} : {1} ms", result.Test.Name, diff.TotalMilliseconds);
			} else {
				if (result.IsSuccess ()) {
					Writer.Write ("\t[PASS] ");
				} else if (result.IsIgnored ()) {
					Writer.Write ("\t[IGNORED] ");
				} else if (result.IsError ()) {
					Writer.Write ("\t[FAIL] ");
				} else {
					Writer.Write ("\t[INFO] ");
				}
				Writer.Write (result.Test.Name);
				
				string message = result.Message;
				if (!String.IsNullOrEmpty (message)) {
					Writer.Write (" : {0}", message.Replace ("\r\n", "\\r\\n"));
				}
				Writer.WriteLine ();
						
				string stacktrace = result.StackTrace;
				if (!String.IsNullOrEmpty (result.StackTrace)) {
					string[] lines = stacktrace.Split (new char [] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
					foreach (string line in lines)
						Writer.WriteLine ("\t\t{0}", line);
				}
			}
		}
Exemplo n.º 8
0
 protected override void Run(TestResult result, TestListener listener)
 {
     result.Failure(message);
 }