public TestCaseElement (TestMethod testCase, TouchRunner runner) : base (testCase, runner) { Caption = testCase.Name; Value = "NotExecuted"; this.Tapped += async delegate { if (!Runner.OpenWriter (Test.FullName)) return; var suite = (testCase.Parent as TestSuite); var context = TestExecutionContext.CurrentContext; context.TestObject = Reflect.Construct (testCase.Method.ReflectedType, null); suite.GetOneTimeSetUpCommand ().Execute (context); await Run (); suite.GetOneTimeTearDownCommand ().Execute (context); Runner.CloseWriter (); // display more details on (any) failure (but not when ignored) if ((TestCase.RunState == RunState.Runnable) && !Result.IsSuccess ()) { var root = new RootElement ("Results") { new Section () { new TestResultElement (Result) } }; var dvc = new DialogViewController (root, true) { Autorotate = true }; runner.NavigationController.PushViewController (dvc, true); } else if (GetContainerTableView () != null) { var root = GetImmediateRootElement (); root.Reload (this, UITableViewRowAnimation.Fade); } }; }
public TestElement (ITest test, TouchRunner runner) : base ("?", "?", UITableViewCellStyle.Subtitle) { if (test == null) throw new ArgumentNullException ("test"); if (runner == null) throw new ArgumentNullException ("runner"); Test = test; Runner = runner; }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { window = new UIWindow(UIScreen.MainScreen.Bounds); runner = new TouchRunner(window); // register every tests included in the main application/assembly runner.Add(System.Reflection.Assembly.GetExecutingAssembly()); window.RootViewController = new UINavigationController(runner.GetViewController()); window.MakeKeyAndVisible(); return true; }
public TestElement(ITest test, TouchRunner runner) : base("?", "?", UITableViewCellStyle.Subtitle) { if (test == null) { throw new ArgumentNullException("test"); } if (runner == null) { throw new ArgumentNullException("runner"); } Test = test; Runner = runner; }
public TestSuiteElement (TestSuite test, TouchRunner runner) : base (test, runner) { Caption = Suite.Name.Split('.').LastOrDefault() ?? ""; int count = Suite.TestCaseCount; if (count > 0) { Accessory = UITableViewCellAccessory.DisclosureIndicator; DetailColor = DarkGreen; Value = String.Format ("{0} test case{1}, {2}", count, count == 1 ? String.Empty : "s", Suite.RunState); Tapped += delegate { runner.Show (Suite); }; } else { DetailColor = UIColor.Orange; Value = "No test was found inside this suite"; } }
public TestCaseElement(TestMethod testCase, TouchRunner runner) : base(testCase, runner) { Caption = testCase.Name; Value = "NotExecuted"; this.Tapped += async delegate { if (!Runner.OpenWriter(Test.FullName)) { return; } var suite = (testCase.Parent as TestSuite); var context = TestExecutionContext.CurrentContext; context.TestObject = Reflect.Construct(testCase.Method.ReflectedType, null); suite.GetOneTimeSetUpCommand().Execute(context); await Run(); suite.GetOneTimeTearDownCommand().Execute(context); Runner.CloseWriter(); // display more details on (any) failure (but not when ignored) if ((TestCase.RunState == RunState.Runnable) && !Result.IsSuccess()) { var root = new RootElement("Results") { new Section() { new TestResultElement(Result) } }; var dvc = new DialogViewController(root, true) { Autorotate = true }; runner.NavigationController.PushViewController(dvc, true); } else if (GetContainerTableView() != null) { var root = GetImmediateRootElement(); root.Reload(this, UITableViewRowAnimation.Fade); } }; }
public TestSuiteElement(TestSuite test, TouchRunner runner) : base(test, runner) { Caption = Suite.Name.Split('.').LastOrDefault() ?? ""; int count = Suite.TestCaseCount; if (count > 0) { Accessory = UITableViewCellAccessory.DisclosureIndicator; DetailColor = DarkGreen; Value = String.Format("{0} test case{1}, {2}", count, count == 1 ? String.Empty : "s", Suite.RunState); Tapped += delegate { runner.Show(Suite); }; } else { DetailColor = UIColor.Orange; Value = "No test was found inside this suite"; } }