private void RunTests() { this.Title = "Unit Tests for " + new AssemblyName(this.GetType().Assembly.FullName).Name; if (TestRunner == null) { try { OnTestRunStarted(); } catch (Exception e) { MethodInfo method = GetType().GetMethod("OnTestRunStarted", BindingFlags.NonPublic | BindingFlags.Instance); this.m_headerOutcome = new MethodOutcome(method); this.m_headerOutcome.SetOutcome(e); this.m_headerView.SetHtml(TestClassResultActivity.GetHTMLDescriptionFor(this.m_headerOutcome)); this.m_headerView.Visibility = ViewStates.Visible; this.ResultBar.SetColorByState(TestState.Failed); Toast.MakeText(this, "OnTestRunStarted() notification failed.", ToastLength.Long).Show(); return; } this.m_headerView.Visibility = ViewStates.Gone; this.ResultBar.SetColorByState(TestState.Running); AsyncTestRunner.Run(this, this.CreateTestRunner, this.OnTestRunFinished); } }
private bool RunOnTestRunEnded() { try { OnTestRunEnded(); return(true); } catch (Exception e) { MethodInfo method = GetType().GetMethod("OnTestRunEnded", BindingFlags.NonPublic | BindingFlags.Instance); this.m_headerOutcome = new MethodOutcome(method); this.m_headerOutcome.SetOutcome(e); this.m_headerView.SetHtml(TestClassResultActivity.GetHTMLDescriptionFor(this.m_headerOutcome)); this.m_headerView.Visibility = ViewStates.Visible; this.ResultBar.SetColorByState(TestState.Failed); return(false); } }
protected override void OnItemClicked(AdapterView.ItemClickEventArgs e) { TestClass testClass = this.ListAdapter.GetItem(e.Position); TestClassResultActivity.StartActivity(this, testClass); }
protected override string GetHTMLDescriptionFor(TestMethod testMethod) { return(TestClassResultActivity.GetHTMLDescriptionFor(testMethod)); }
public TestMethodsAdapter(TestClassResultActivity activity) : base(activity) { }