示例#1
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            Console.SetOut(_logSaver);
            SetUpFixture.SetUp();

            // create a new window instance based on the screen size
            _window = new UIWindow(UIScreen.MainScreen.Bounds);
            _runner = new NonterminatingTouchRunner(_window, _logSaver);

            // register every tests included in the main application/assembly
            _runner.Add(System.Reflection.Assembly.GetExecutingAssembly());
            _runner.AutoStart = true;
            _runner.TerminateAfterExecution = true;

            _window.RootViewController = new UINavigationController(_runner.GetViewController());

            // make the window visible
            _window.MakeKeyAndVisible();

            #if ENABLE_TEST_CLOUD
            Xamarin.Calabash.Start();
            #endif

            return(true);
        }
示例#2
0
        protected override void OnCreate(Bundle bundle)
        {
            Console.SetOut(_logSaver);
            SetUpFixture.SetUp();

            AddTest(Assembly.GetExecutingAssembly());

            // to add tests in additional assemblies, uncomment/adapt the line below
            // AddTest (typeof (Your.Library.TestClass).Assembly);

            // there is currently an issue where the test runner blocks the UI thread.
            Intent.PutExtra("automated", true);

            // Once you called base.OnCreate(), you cannot add more assemblies.
            base.OnCreate(bundle);
        }