NUnit.UI.TouchRunner Class
The TouchRunner type is the main class for Touch.Unit. With a few settings it will create it's own UI and can start (by user input or automatically) executing all unit tests that were added to the runner's instance.

See Also: TouchRunner Members

Syntax

public class TouchRunner : NUnit.Framework.Api.ITestListener

Remarks

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;
            }
            

Requirements

Namespace: NUnit.UI
Assembly: NUnitLite (in NUnitLite.dll)
Assembly Versions: 0.6.0.0, 1.0.0.0