See Also: TouchRunner Members
By default all logs will be displayed on the console, i.e. they will be shown in MonoDevelop's Application Output pad.
c# Example
// a common FinishedLaunching implementation to use Touch.Unit inside a project
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
window = new UIWindow (UIScreen.MainScreen.Bounds);
runner = new TouchRunner (window);
// register every tests included in the main application/assembly
runner.Add (System.Reflection.Assembly.GetExecutingAssembly ());
window.RootViewController = new UINavigationController (runner.GetViewController ());
window.MakeKeyAndVisible ();
return true;
}
Logs can also be sent to a network server, e.g. for automated testing.
c# Example
// a FinishedLaunching implementation to use the automated testing features
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
window = new UIWindow (UIScreen.MainScreen.Bounds);
runner = new TouchRunner (window);
// register every tests included in the main application/assembly
runner.Add (System.Reflection.Assembly.GetExecutingAssembly ());
// you can use a TcpTextWriter or set your own custom writer
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;
window.RootViewController = new UINavigationController (runner.GetViewController ());
window.MakeKeyAndVisible ();
return true;
}