Example #1
0
        TestSuiteElement Setup(TestSuite suite)
        {
            TestSuiteElement tse = new TestSuiteElement(suite, this);

            suite_elements.Add(suite, tse);

            var root = new RootElement("Tests");

            Section section = new Section(suite.Name);

            foreach (ITest test in suite.Tests)
            {
                TestSuite ts = (test as TestSuite);
                if (ts != null)
                {
                    section.Add(Setup(ts));
                }
                else
                {
                    TestCase tc = (test as TestCase);
                    if (tc != null)
                    {
                        section.Add(Setup(tc));
                    }
                    else
                    {
                        throw new NotImplementedException(test.GetType().ToString());
                    }
                }
            }

            root.Add(section);

            if (section.Count > 1)
            {
                Section options = new Section()
                {
                    new StringElement("Run all", delegate() {
                        if (OpenWriter(suite.Name))
                        {
                            Run(suite);
                            CloseWriter();
                        }
                    })
                };
                root.Add(options);
            }

            var dv = new DialogViewController(root, true)
            {
                Autorotate = true
            };

            suites_dvc.Add(suite, dv);
            return(tse);
        }
Example #2
0
		TestSuiteElement Setup (TestSuite suite)
		{
			TestSuiteElement tse = new TestSuiteElement (suite, this);
			suite_elements.Add (suite, tse);
			
			var root = new RootElement ("Tests");
		
			Section section = new Section (suite.Name);
			foreach (ITest test in suite.Tests) {
				TestSuite ts = (test as TestSuite);
				if (ts != null) {
					section.Add (Setup (ts));
				} else {
					TestMethod tc = (test as TestMethod);
					if (tc != null) {
						section.Add (Setup (tc));
					} else {
						throw new NotImplementedException (test.GetType ().ToString ());
					}
				}
			}
		
			root.Add (section);
			
			if (section.Count > 1) {
				Section options = new Section () {
					new StringElement ("Run all", delegate () {
						if (OpenWriter (suite.Name)) {
							Run (suite);
							CloseWriter ();
							suites_dvc [suite].Filter ();
						}
					})
				};
				root.Add (options);
			}

			suites_dvc.Add (suite, new TouchViewController (root));
			return tse;
		}