Ejemplo n.º 1
0
        public override View GetView(Context context, View convertView, ViewGroup parent)
        {
            View view = base.GetView(context, convertView, parent);

            view.Click += delegate {
                if (TestCase.RunState != RunState.Runnable)
                {
                    return;
                }

                AndroidRunner runner = AndroidRunner.Runner;
                if (!runner.OpenWriter("Run " + TestCase.FullName, context))
                {
                    return;
                }

                try
                {
                    runner.Run(TestCase);
                }
                finally {
                    runner.CloseWriter();
                    Update();
                }

                if (!Result.IsSuccess())
                {
                    Intent intent = new Intent(context, typeof(TestResultActivity));
                    intent.PutExtra("TestCase", Name);
                    intent.AddFlags(ActivityFlags.NewTask);
                    context.StartActivity(intent);
                }
            };
            return(view);
        }
Ejemplo n.º 2
0
        public void Run()
        {
            AndroidRunner runner = AndroidRunner.Runner;

            if (!runner.OpenWriter("Run " + test_suite, this))
            {
                return;
            }

            try {
                foreach (NUnit.Framework.Internal.Test test in suite.Tests)
                {
                    runner.Run(test);
                }
            }
            finally {
                runner.CloseWriter();
            }

            foreach (TestElement te in main)
            {
                te.Update();
            }
        }