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

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

The `AssignmentSequencer` is responsible for the sequencing of parameters to be provided to a particular theory method test. It determines what potential parameters need to be provided to the parameters in the theory test method. Based on the number of parameters in the theory method test, additional `AssignmentSequencer`s will be created. If there are still parameters that need to be assigned a value and there are still potential values to assign to those parameters, assign an unused value to the next parameter and create a new `AssignmentSequencer`, determining if all parameters have then been assigned a value. Once all of the parameters in the theory method test have been assigned, that theory method will be run with that configuration. All permutations of potential parameters will be provided to the theory method.

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
--- | --- | ---
|  | AssignmentSequencer(parameterAssignment:Assignments, frameworkMethod:FrameworkMethod, testClass:Class, anchor:TheoryAnchor) Constructor. | AssignmentSequencer
|  | evaluate(parentToken:AsyncTestToken):void Determines if all parameters have been assigned for a particular configuration of a theory method. | AssignmentSequencer
|  | handleChildExecuteComplete(result:ChildResult):void Determine if any errors were encountered if the theory method test executed. | AssignmentSequencer

Protected Methods

| Method | Defined By
--- | --- | ---
|  | runWithCompleteAssignment(complete:Assignments):void Runs the theory for the complete set of assigned parameters. | AssignmentSequencer
|  | sendComplete(error:Error = null):void [override] Reports to the parentToken that the current configuration of parameter assignments have finished running in the theory method test and determines if any error were encountered during execution of that test. | AssignmentSequencer

Constructor Detail

AssignmentSequencer | () | Constructor

`public function AssignmentSequencer(parameterAssignment:Assignments, frameworkMethod:FrameworkMethod, testClass:Class, anchor:TheoryAnchor)`

Constructor.

Parameters

| `parameterAssignment:Assignments` — The current parameter assignments for a theory method test.
| `frameworkMethod:FrameworkMethod` — The theory method that is being tested.
| `testClass:Class` — The test class that contains the theory method.
| `anchor:TheoryAnchor` — The anchor for the theory method.

Method Detail

evaluate | () | method

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

Determines if all parameters have been assigned for a particular configuration of a theory method. If they have all been assigned, run the theory with the particular parameter configuration. If all parameter values have not been assinged, determine what parameters can be provided to the next unassigned parameter.

Parameters

| `parentToken:AsyncTestToken` — The token to be notified when the theory method has finished running for a particluar permutation of parameters.

handleChildExecuteComplete | () | method |

`public function handleChildExecuteComplete(result:ChildResult):void`

Determine if any errors were encountered if the theory method test executed. If the error was not an `AssumptionViolatedException`, add it to the array of encountered errors and stop running the theory test. If there are still parameters that need to be assigned a value and there are still potential values to assign to those parameters, assign an unused value to the next parameter and create a new `AssignmentSequencer`, determining if all parameters have then been assigned a value. If there are no furuther potential values to assign a parameter or all values have already been assigned to a parameter, this `AssignmentSequencer` has finished its duty to sequence parameters.

Parameters

| `result:ChildResult` — A `ChildResult` that contains potential errors encountered during the theory's execution.

runWithCompleteAssignment | () | method |

`protected function runWithCompleteAssignment(complete:Assignments):void`

Runs the theory for the `complete` set of assigned parameters.

Parameters

| `complete:Assignments` — Contains a permutation of current assigned parameter / value pairs to be supplied to the theory method test for this particular configuration.

sendComplete | () | method |

`override protected function sendComplete(error:Error = null):void`

Reports to the parentToken that the current configuration of parameter assignments have finished running in the theory method test and determines if any error were encountered during execution of that test.

Parameters

| `error:Error` (default = `null`)`` — A potential error that was encountered during a configuration of the theory meethod.

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