protected override void OnCreate(Bundle bundle) { SensusContext.Current = new TestSensusContext { MainThreadSynchronizer = new MainConcurrent() }; AddTestAssembly(Assembly.GetExecutingAssembly()); AddExecutionAssembly(typeof(ExtensibilityPointFactory).Assembly); AutoStart = true; TerminateAfterExecution = false; XUnitResultCounter resultCounter = new XUnitResultCounter(); resultCounter.ResultsDelivered += (sender, results) => { RunOnUiThread(() => { TextView resultView = new TextView(this) { ContentDescription = "unit-test-results", Text = results }; new AlertDialog.Builder(this).SetView(resultView).Show(); }); }; ResultChannel = resultCounter; base.OnCreate(bundle); }
public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions) { SensusContext.Current = new TestSensusContext { MainThreadSynchronizer = new MainConcurrent() }; AddTestAssembly(Assembly.GetExecutingAssembly()); AddExecutionAssembly(typeof(ExtensibilityPointFactory).Assembly); AutoStart = true; TerminateAfterExecution = false; XUnitResultCounter resultCounter = new XUnitResultCounter(); resultCounter.ResultsDelivered += (sender, results) => { InvokeOnMainThread(() => { new UIAlertView("Results", results, default(IUIAlertViewDelegate), "Close").Show(); }); }; ResultChannel = resultCounter; #if ENABLE_TEST_CLOUD Xamarin.Calabash.Start(); #endif return(base.FinishedLaunching(uiApplication, launchOptions)); }