forked from xamarin/Touch.Unit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAppDelegate.cs
49 lines (44 loc) · 1.69 KB
/
AppDelegate.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// AppDelegate.cs: Customize (add tests assemblies) your runner application here!
//
// Authors:
// Sebastien Pouliot <[email protected]>
//
// Copyright 2011 Xamarin Inc. All rights reserved
using System.Reflection;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.NUnit.UI;
namespace MonoTouch.NUnit {
/// <summary>
/// The UIApplicationDelegate for the application. This class is responsible for launching the
/// User Interface of the application, as well as listening (and optionally responding) to
/// application events from iOS.
/// </summary>
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate {
// class-level declarations
UIWindow window;
TouchRunner runner;
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
window = new UIWindow (UIScreen.MainScreen.Bounds);
runner = new TouchRunner (window);
// tests can be inside the main assembly
runner.Add (Assembly.GetExecutingAssembly ());
// otherwise you need to ensure that the test assemblies will
// become part of the app bundle
runner.Add (typeof (MonoTouchFixtures.RegressionTest).Assembly);
#if false
// you can use the default or set your own custom writer (e.g. save to web site and tweet it ;-)
runner.Writer = new TcpTextWriter ("10.0.1.2", 16384);
// start running the test suites as soon as the application is loaded
runner.AutoStart = true;
// crash the application (to ensure it's ended) and return to springboard
runner.TerminateAfterExecution = true;
#endif
window.RootViewController = new UINavigationController (runner.GetViewController ());
window.MakeKeyAndVisible ();
return true;
}
}
}