示例#1
0
        protected override void OnCreate(Bundle bundle)
        {
            // Register tests from shared library.
            AddTestAssembly(typeof(Config).Assembly);

            // Try to send results to the host via a socket for CI.
            try
            {
                ResultChannel = TrxResultChannel.CreateTcpTrxResultChannel(ResultChannelHost, Config.ResultChannelPort).Result;
            }
            catch (Exception e)
            {
                Log.Warn("AppCenterTest", $"Could not connect to host for reporting results.\n{e}");
            }

            // start running the test suites as soon as the application is loaded
            AutoStart = true;

#if !DEBUG
            // crash the application (to ensure it's ended) and return to springboard
            TerminateAfterExecution = true;
#endif

            // you cannot add more assemblies once calling base
            base.OnCreate(bundle);
        }
示例#2
0
        protected override void OnCreate(Bundle bundle)
        {
            // tests can be inside the main assembly
            //AddTestAssembly(Assembly.GetExecutingAssembly());
            AddTestAssembly(Settings.TargetAssembly);

            AddExecutionAssembly(typeof(ExtensibilityPointFactory).Assembly);
            // or in any reference assemblies

            //AddTestAssembly(typeof(PortableTests).Assembly);
            // or in any assembly that you load (since JIT is available)

#if false
            // you can use the default or set your own custom writer (e.g. save to web site and tweet it ;-)
            Writer = new TcpTextWriter("10.0.1.2", 16384);
            // start running the test suites as soon as the application is loaded
            AutoStart = true;
            // crash the application (to ensure it's ended) and return to springboard
            TerminateAfterExecution = true;
#endif
            ResultChannel = new TrxResultChannel(Path.Combine(Application.Context.GetExternalFilesDir("").AbsolutePath, Settings.TestResultFileName));

            // you cannot add more assemblies once calling base
            base.OnCreate(bundle);
        }
示例#3
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 uiApplication, NSDictionary launchOptions)
        {
            // Clear NSUserDefaults before the test.
            var plist     = NSUserDefaults.StandardUserDefaults;
            var appDomain = NSBundle.MainBundle.BundleIdentifier;

            plist.RemovePersistentDomain(appDomain);

            // Register tests from shared library.
            AddTestAssembly(typeof(Config).Assembly);

            // Try to send results to the host via a socket for CI.
            try
            {
                ResultChannel = TrxResultChannel.CreateTcpTrxResultChannel(ResultChannelHost, Config.ResultChannelPort).Result;
            }
            catch (Exception e)
            {
                Console.WriteLine($"[AppCenterTest] WARN Could not connect to host for reporting results.\n{e}");
            }

            // start running the test suites as soon as the application is loaded
            AutoStart = true;

#if !DEBUG
            // crash the application (to ensure it's ended) and return to springboard
            TerminateAfterExecution = true;
#endif
            DistributeUpdateTest.DistributeEvent += ConfigureDataForDistribute;
            UiApplication = uiApplication;
            LaunchOptions = launchOptions;
            return(base.FinishedLaunching(uiApplication, launchOptions));
        }
示例#4
0
        protected override void OnCreate(Bundle bundle)
        {
            // Clear shared preferences before the test.
            var prefs = GetSharedPreferences("AppCenter", FileCreationMode.Private);

            prefs.Edit().Clear();

            // Register tests from shared library.
            AddTestAssembly(typeof(Config).Assembly);

            // Try to send results to the host via a socket for CI.
            try
            {
                ResultChannel = TrxResultChannel.CreateTcpTrxResultChannel(ResultChannelHost, Config.ResultChannelPort).Result;
            }
            catch (Exception e)
            {
                Log.Warn("AppCenterTest", $"Could not connect to host for reporting results.\n{e}");
            }

            // start running the test suites as soon as the application is loaded
            AutoStart = true;

#if !DEBUG
            // crash the application (to ensure it's ended) and return to springboard
            TerminateAfterExecution = true;
#endif
            Distribute.SetEnabledForDebuggableBuild(true);
            DistributeUpdateTest.DistributeEvent += ConfigureDataForDistribute;

            // you cannot add more assemblies once calling base
            base.OnCreate(bundle);
        }
        //
        // 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 uiApplication, NSDictionary launchOptions)
        {
            // Register tests from shared library.
            AddTestAssembly(typeof(Config).Assembly);

            // Try to send results to the host via a socket for CI.
            try
            {
                ResultChannel = TrxResultChannel.CreateTcpTrxResultChannel(ResultChannelHost, Config.ResultChannelPort).Result;
            }
            catch (Exception e)
            {
                Console.WriteLine($"[AppCenterTest] WARN Could not connect to host for reporting results.\n{e}");
            }

            // start running the test suites as soon as the application is loaded
            AutoStart = true;

#if !DEBUG
            // crash the application (to ensure it's ended) and return to springboard
            TerminateAfterExecution = true;
#endif

            return(base.FinishedLaunching(uiApplication, launchOptions));
        }