Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt

Defines the mode in which a unit test is run...

 

Test.ANY( )

Indicates that a test may create zero or more results, and the number of results does not affect the overall test success.

This is the default for tests that do not specify a testMode.

Test.EXPECT( numResults )

Indicate that the current test is expected to generate numResults test results. If the test does not generate that many results, the test will fail even if none of the collected results failed.

Test.ASYNCH( [gameSeconds[, numResults]] )

Indicates the current test is asynchronous and will be appended by subsequent Test.APPEND( ) tests.

Both parameters are optional (specify null to use default):

  • gameSeconds – how long to allow additional results to be gathered for (default: 60 game seconds)
  • numResults – the number of results required to pass the test (default: test doesn't require specific number of results)
Results can be provided by the current Test.ASYNCH( ) and

Overview

When defining a Unit Test with Test(), a "test mode" is required to define the way in which the test will be processed.

There are currently 4 modes available:

ModeNotesAPI Version
Test.ANY()

A basic test test which will pass if none of it's assertions fail and no test-failing Test Signals are triggered.

1.0
Test.EXPECT()The same as Test.ANY( ) but requires a specific number of results to be logged before allowing a test to pass.1.0
Test.ASYNCH()

A asynchronous test that can have results added to it by subsequent Test.APPEND( ) tests.

Only one Test.ASYNCH( ) can run at a time.

Queued Test.ANY( ) or Test.EXPECT( ) tests will not be triggered until the current asynchronous test phase is complete (timeout, fail or pass).

The test will remain active until it either fails, passes or times-out. Very useful for testing non-sequential events.

1.0
Test.APPEND(
 testName 
)
Indicates the test is a continuation of
Appends results to a specific Test.ASYNCH( )
test called testName and it's results will be appended to that test.

If the test called testName is not currently active (not started, timed-out, aborted, failed or passed), the Test.APPEND( ) will be skipped.

 
if that test is currently active.1.0
Div
classbox
Availability
Status
colourGreen
titleStable

Requires:

Div
classbox

Test API

Topics:

Child pages (Children Display)
alltrue
depthall
pageTest API
excerpttrue