C# Класс NUnitLite.AutoRun

The AutoRun class is used by executable test assemblies to control their own execution. Call it from your executable test like this: new AutoRun().Execute(args); The arguments can be those passed into your exe or constructed for the purpose in your code. If the tests are in a dll, you can write a stub executable that runs them like this: new Autorun().Execute(testAssembly, args); When running tests compiled against the portable framework, the methods above are not available. Run your tests like this: new AutoRun().Execute(testAssembly, args, output, input); Where output is an ExtendedTextWriter (normally a ColorConsoleWriter) and input is usually Console.In and is used by the --wait option.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AutoRun ( ) : System

Default Constructor, only used where GetCallingAssembly is available

AutoRun ( Assembly testAssembly ) : System

Constructor for use where GetCallingAssembly is not available, requiring the assembly to be passed.

Execute ( string args ) : int

Execute the tests in the assembly, passing in a list of arguments.

Execute ( string args, NUnit.Common.ExtendedTextWriter writer, TextReader reader ) : int

Execute the tests in the assembly, passing in a list of arguments, a test assembly a writer and a reader. For use in builds for runtimes that don't support Assembly.GetCallingAssembly().

Описание методов

AutoRun() публичный Метод

Default Constructor, only used where GetCallingAssembly is available
public AutoRun ( ) : System
Результат System

AutoRun() публичный Метод

Constructor for use where GetCallingAssembly is not available, requiring the assembly to be passed.
public AutoRun ( Assembly testAssembly ) : System
testAssembly System.Reflection.Assembly The test assembly
Результат System

Execute() публичный Метод

Execute the tests in the assembly, passing in a list of arguments.
public Execute ( string args ) : int
args string arguments for NUnitLite to use
Результат int

Execute() публичный Метод

Execute the tests in the assembly, passing in a list of arguments, a test assembly a writer and a reader. For use in builds for runtimes that don't support Assembly.GetCallingAssembly().
public Execute ( string args, NUnit.Common.ExtendedTextWriter writer, TextReader reader ) : int
args string Arguments passed to NUnitLite
writer NUnit.Common.ExtendedTextWriter An ExtendedTextWriter to which output will be written
reader System.IO.TextReader A TextReader used when waiting for input
Результат int