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.
파일 보기 프로젝트 열기: nunit/nunit 1 사용 예제들

공개 메소드들

메소드 설명
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