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( n )

Indicate that the current test is expected to generate n test results. If the test does not generate that many results, the test will fail.

Test.until( n[, gameSeconds] )

Indicates that a a test is split in to more than one unit and is used for asynchronous testing. The number n indicates how many results are required to complete the test. The optional gameSeconds parameter indicates how long to wait before timing out the test (defaults to 60 seconds).

Results can be provided by the current Test.until( ) and subsequent Test.append( ) tests. No new tests can will start until the number of required results is generated or a call is made to Test.abort( testName ), or the test times out, or the test is aborted.

Test.duration( gameSeconds )

Indicates the test should run for a specific amount of time and gather all results during that time. The number gameSeconds defines how many game seconds (which are affected by game speed) results will be gathered for.

Results can be provided by the current Test.duration( ) and subsequent Test.append( ) tests.  No No new tests can will start until the time has elapsed or a call is made to Test.abort( testName )number of required results is generated, or the test times out, or the test is aborted.

Test.append( testName )

Indicates the test is a continuation of a specific Test.until( ) or a Test.duration( ) test that has a name of testName.

If the test called testName is not currently active, tests that append results to that test will be ignored.