API Documentation | All Packages | All Classes | Index | Frames No Frames |
TheoryAnchor

Package | org.flexunit.experimental.runners.statements
Class | public class TheoryAnchor
Inheritance | TheoryAnchor AsyncStatementBase Object
Implements | IAsyncStatement

The `TheoryAnchor` is responsible for keeping track of the progress of a particular theory method. It starts the process of running the theory method for each possible combination of provided parameter, and it also is responsible for handling the overall operation of the theory.

Protected Properties
Hide Inherited Protected Properties
Show Inherited Protected Properties

| Property | Defined By
--- | --- | ---
|  | myToken : AsyncTestToken The AsyncTestToken for the current statment. | AsyncStatementBase
|  | parentToken : AsyncTestToken The AsyncTestToken for the parent of the current statment. | AsyncStatementBase

Public Methods

| Method | Defined By
--- | --- | ---
|  | TheoryAnchor(method:FrameworkMethod, testClass:TestClass) Constructor. | TheoryAnchor
|  | evaluate(parentToken:AsyncTestToken):void Determines all possible parameters that a theory could use and starts the process creating unique combinations of parameters to run in the theory. | TheoryAnchor

Protected Methods
Show Inherited Protected Methods
Show Inherited Protected Methods

| Method | Defined By
--- | --- | ---
|  | handleMethodExecuteComplete(result:ChildResult):void Determine if any errors were thrown during execution of the theory or if the theory did not successfully run for any given data subset. | TheoryAnchor
|  | sendComplete(error:Error = null):void If the parentToken has not already been alerted that the statement has completed, alert the parent token that the current statement has finished. | AsyncStatementBase

Constructor Detail

TheoryAnchor | () | Constructor

`public function TheoryAnchor(method:FrameworkMethod, testClass:TestClass)`

Constructor.

Parameters

| `method:FrameworkMethod` — The theory method to run.
| `testClass:TestClass` — The test class that contains the theory to run.

Method Detail

evaluate | () | method

`public function evaluate(parentToken:AsyncTestToken):void`

Determines all possible parameters that a theory could use and starts the process creating unique combinations of parameters to run in the theory.

Parameters

| `parentToken:AsyncTestToken` — The token to be notified when the test method has finished running.

handleAssumptionViolation | () | method |

`classInternal function handleAssumptionViolation(e:AssumptionViolatedException):void`

Adds a provided `AssumptionViolatedException` to an array of `AssumptionViolatedException` encountered during the course of executing the theory.

Parameters

| `e:AssumptionViolatedException` — The `AssumptionViolatedException` to add.

handleDataPointSuccess | () | method |

`classInternal function handleDataPointSuccess():void`

Updates the number of successes for the given theory. This should be called when the theory successfully runs for a given parameter set.

handleMethodExecuteComplete | () | method |

`protected function handleMethodExecuteComplete(result:ChildResult):void`

Determine if any errors were thrown during execution of the theory or if the theory did not successfully run for any given data subset.

Parameters

| `result:ChildResult` — The result of the executed theory.

nullsOk | () | method |

`classInternal function nullsOk():Boolean`

Determines whether null paramater values are acceptable for a specific theory.

Returns

| `Boolean` — a Boolean value indicating whether null parameter values are ok.

reportParameterizedError | () | method |

`classInternal function reportParameterizedError(e:Error, ... params):Error`

Generates a `ParameterizedAssertionError` if parameters are provided; otherwise, just returns the error.

Parameters

| `e:Error` — The error that was thrown.
| `... params` — The parameters that were provided to the theory when the error was thrown.

Returns

| `Error` — the provided error or a `ParameterizedAssertionError` if parameters are provided.

Thu Apr 10 2014, 08:07 AM +10:00