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 numResults )

Indicate that the current test is expected to generate n test 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.untilfor( n[gameSeconds[, gameSeconds numResults]] )

Indicates that a a the current 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 will start until the number of required results is generated, or the test times out, or the test is aborted.

Test.duration( gameSeconds )

Indicates the test should run for a specific amount of time. The number gameSeconds defines how many game seconds (which are affected by game speed) results will be gathered for.asynchronous and will be appended by future tests (see Test.append( ) below).

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.durationfor( ) and subsequent Test.append( ) tests. No new Test.any( ) or Test.expect( ) tests will start until the number of required results is generated, or the test times out, or the test is abortedasynchronous test phase is complete (failed, passed, timed-out or aborted).

Test.append( testName )

Indicates the test is a continuation of a specific Test.untilfor( ) or a Test.duration( ) test that has a name of testNametest 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), tests that append results to that test will be ignoredskipped.