TestCase Class
Summarizes information about a single test case.
Constructors
Code new TestCase(int id, String description, TestFunction test, int callbackFunctionsOutstanding) #
TestCase(this.id, this.description, this.test, this.callbackFunctionsOutstanding) : currentGroup = _currentGroup, _setUp = _testSetup, _tearDown = _testTeardown;
Methods
Code void error(String messageText, String stack) #
void error(String messageText, String stack) { result = _ERROR; message = messageText; stackTrace = stack; _complete(); }
Code void fail(String messageText, String stack) #
void fail(String messageText, String stack) { result = _FAIL; message = messageText; stackTrace = stack; _complete(); }
Code void pass() #
void pass() { result = _PASS; _complete(); }
Code void run() #
void run() { if (enabled) { result = stackTrace = null; message = ''; _doneTeardown = false; if (_setUp != null) { _setUp(); } _config.onTestStart(this); test(); } }
Fields
Code int callbackFunctionsOutstanding #
Remaining number of callbacks functions that must reach a 'done' state to wait for before the test completes.
int callbackFunctionsOutstanding;
Code final String currentGroup #
The group (or groups) under which this test is running.
final String currentGroup;
Code final String description #
A description of what the test is specifying.
final String description;
Code String result #
One of _PASS
, _FAIL
, _ERROR
, or null
if the test hasn't run yet.
String result;
Code String stackTrace #
Stack trace associated with this test, or null if it succeeded.
String stackTrace;
Code TestFunction test #
The body of the test case.
TestFunction test;