Back to Nunit

NUnit Xamarin Runners

docs/articles/xamarin-runners/index.md

latest1.6 KB
Original Source

NUnit Xamarin Runners

The NUnit Xamarin Runners provide NUnit 3 test runners for Xamarin and mobile devices. See Testing Xamarin projects using NUnit 3 for more general information.

Options

Runner options are set inside a TestOptions object. For example:

csharp
var nunit = new NUnit.Runner.App();

nunit.Options = new TestOptions
{
    AutoRun = true
};

The following options are available:

OptionVersion addedTypeUsage
AutoRun3.0BooleanIf True, the tests will run automatically when the app starts, otherwise you must run them manually.
TerminateAfterExecution3.6.1BooleanIf True, app will exit cleanly after test execution.
TcpWriterParameters3.6.1TcpWriterInfoProvide a TCP listener host and port, sends result as XML to the listening server. Takes a TcpWriterInfo - see below.
CreateXmlResultFile3.6.1BooleanIf True, create a xml file containing results.
ResultFilePath3.6.1StringSpecify file path to save xml result file.

TcpWriterInfo

TcpWriterInfo takes three parameters: hostname, port, and an optional timeout in seconds (default 10).

csharp
TcpWriterParameters = new TcpWriterInfo("192.168.0.108", 13000, 10);