Example #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            Title = "C# Client Library Tests";

            RequestWindowFeature(WindowFeatures.Progress);

            SetContentView(Resource.Layout.Harness);

            this.runStatus = FindViewById <TextView>(Resource.Id.RunStatus);

            this.list = FindViewById <ExpandableListView>(Resource.Id.List);
            this.list.SetAdapter(new TestListAdapter(this, App.Listener));
            this.list.ChildClick += (sender, e) =>
            {
                Intent testIntent = new Intent(this, typeof(TestActivity));

                GroupDescription groupDesc = (GroupDescription)this.list.GetItemAtPosition(e.GroupPosition);
                TestDescription  desc      = groupDesc.Tests.ElementAt(e.ChildPosition);

                testIntent.PutExtra("name", desc.Test.Name);
                testIntent.PutExtra("desc", desc.Test.Description);
                testIntent.PutExtra("log", desc.Log);

                StartActivity(testIntent);
            };

            SetProgressBarVisibility(true);
        }
Example #2
0
            public override View GetChildView(int groupPosition, int childPosition, bool isLastChild, View convertView, ViewGroup parent)
            {
                GroupDescription group = this.groups[groupPosition];
                TestDescription  test  = group.Tests.ElementAt(childPosition);

                View view = convertView;

                if (view == null)
                {
                    view = this.activity.LayoutInflater.Inflate(Resource.Layout.ListedTest, null);
                }

                TextView text = view.FindViewById <TextView>(Resource.Id.TestName);

                text.Text = test.Test.Name;

                if (!test.Test.Passed)
                {
                    text.SetTextColor(Color.Red);
                }
                else
                {
                    text.SetTextColor(Color.White);
                }

                return(view);
            }
        void ITestReporter.EndTest(TestMethod test)
        {
            var description = new TestDescription(test, this.logBuilder.ToString());

            this.currentGroup.Tests.Add(description);
        }
 void ITestReporter.EndTest(TestMethod test)
 {
     var description = new TestDescription(test, this.logBuilder.ToString());
     this.currentGroup.Tests.Add(description);
 }