21 using Android.Content;
23 using NUnit.Framework.Internal;
25 namespace Android.NUnitLite.UI {
31 if (Suite.TestCaseCount > 0)
35 public TestSuite Suite {
36 get {
return Test as TestSuite; }
41 int count = Suite.TestCaseCount;
42 var suiteName = Suite.Name.Split(
'.').LastOrDefault() ??
"";
43 string caption = String.Format (
"<b>{0}</b><br>", suiteName);
45 caption +=
"<font color='#ff7f00'>no test was found inside this suite</font>";
46 }
else if (Result == null) {
47 caption += String.Format (
"<font color='green'><b>{0}</b> test case{1}, <i>{2}</i></font>",
48 count, count == 1 ? String.Empty :
"s", Suite.RunState);
50 if (Result.FailCount == 0) {
51 caption += String.Format (
"<font color='green'><b>Success!</b> {0} test{1}</font>",
52 Result.PassCount, Result.PassCount == 1 ? String.Empty :
"s");
54 caption += String.Format (
"<font color='green'>{0} success,</font> <font color='red'>{1} failure{2}, {3} skipped{4}</font>",
55 Result.PassCount, Result.FailCount, Result.FailCount > 1 ?
"s" : String.Empty,
56 Result.SkipCount, Result.SkipCount > 1 ?
"s" : String.Empty);
62 public override View
GetView (Context context, View convertView, ViewGroup parent)
64 View view = base.GetView (context, convertView, parent);
66 if (Suite.TestCaseCount > 0) {
67 view.Click += delegate {
69 intent.PutExtra (
"TestSuite", Name);
70 intent.AddFlags (ActivityFlags.NewTask);
71 context.StartActivity (intent);
TestSuiteElement(TestSuite suite)
override string GetCaption()
override View GetView(Context context, View convertView, ViewGroup parent)
Overriden my most derived classes, creates a view that creates a View with the contents for display ...