IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
NUnitLite.TextRunner Class Reference

TextRunner is a general purpose class that runs tests and outputs to a text-based user interface (TextUI). More...

+ Inheritance diagram for NUnitLite.TextRunner:
+ Collaboration diagram for NUnitLite.TextRunner:

Public Member Functions

 TextRunner (TextUI textUI, NUnitLiteOptions options)
 Initializes a new instance of the TextRunner class. More...
 
int Execute ()
 
int Execute (Assembly callingAssembly)
 Execute a test run More...
 
void ReportResults (ITestResult result)
 
void TestStarted (ITest test)
 Called when a test or suite has just started More...
 
void TestFinished (ITestResult result)
 Called when a test has finished More...
 

Static Public Member Functions

static Dictionary< string, object > MakeRunSettings (NUnitLiteOptions options)
 Make the settings for this run - this is public for testing More...
 
static TestFilter CreateTestFilter (NUnitLiteOptions options)
 Create the test filter for this run - public for testing More...
 

Public Attributes

const int OK = 0
 OK More...
 
const int INVALID_ARG = -1
 Invalid Arguments More...
 
const int FILE_NOT_FOUND = -2
 File not found More...
 
const int FIXTURE_NOT_FOUND = -3
 Test fixture not found More...
 
const int UNEXPECTED_ERROR = -100
 Unexpected error occurred More...
 

Properties

ResultSummary Summary [get, private set]
 

Private Member Functions

int RunTests (TestFilter filter, IDictionary runSettings)
 
int ExploreTests ()
 

Private Attributes

readonly List< Assembly > _assemblies = new List<Assembly>()
 
ITestAssemblyRunner _runner
 
NUnitLiteOptions _options
 
TeamCityEventListener _teamCity
 
TextUI _textUI
 

Detailed Description

TextRunner is a general purpose class that runs tests and outputs to a text-based user interface (TextUI).

Call it from your Main like this: new TextRunner(textWriter).Execute(args); OR new TextUI().Execute(args); The provided TextWriter is used by default, unless the arguments to Execute override it using -out. The second form uses the Console, provided it exists on the platform.

NOTE: When running on a platform without a Console, such as Windows Phone, the results will simply not appear if you fail to specify a file in the call itself or as an option.

Constructor & Destructor Documentation

NUnitLite.TextRunner.TextRunner ( TextUI  textUI,
NUnitLiteOptions  options 
)
inline

Initializes a new instance of the TextRunner class.

Parameters
textUIThe text-based user interface to output results of the run
optionsThe options to use when running the test

Member Function Documentation

int NUnitLite.TextRunner.Execute ( )
inline
void NUnitLite.TextRunner.TestStarted ( ITest  test)
inline

Called when a test or suite has just started

Parameters
testThe test that is starting

Implements NUnit.Framework.Interfaces.ITestListener.

References NUnitLite.TeamCityEventListener.TestStarted().

void NUnitLite.TextRunner.TestFinished ( ITestResult  result)
inline

Member Data Documentation

const int NUnitLite.TextRunner.OK = 0
const int NUnitLite.TextRunner.INVALID_ARG = -1

Invalid Arguments

Referenced by NUnitLite.AutoRun.Execute().

const int NUnitLite.TextRunner.FILE_NOT_FOUND = -2

File not found

Referenced by NUnitLite.TextRunner.Execute().

const int NUnitLite.TextRunner.FIXTURE_NOT_FOUND = -3

Test fixture not found

const int NUnitLite.TextRunner.UNEXPECTED_ERROR = -100

Unexpected error occurred

Referenced by NUnitLite.TextRunner.Execute().

readonly List<Assembly> NUnitLite.TextRunner._assemblies = new List<Assembly>()
private
ITestAssemblyRunner NUnitLite.TextRunner._runner
private
NUnitLiteOptions NUnitLite.TextRunner._options
private
TeamCityEventListener NUnitLite.TextRunner._teamCity
private
TextUI NUnitLite.TextRunner._textUI
private

Property Documentation

ResultSummary NUnitLite.TextRunner.Summary
getprivate set

The documentation for this class was generated from the following file: