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

Package | org.flexunit.experimental.theories.internals
Class | public class Assignments
Inheritance | Assignments Object

The `Assignments` is responsible for keeping track of assigned and unassigned parameters for a given configuration of a theory method.

Public Properties

| Property | Defined By
--- | --- | ---
|  | assigned : Array An array of IPotentialAssignments that have been assigned values. | Assignments
|  | complete : Boolean [read-only] Returns a Boolean value indicating whether all unassigned values have been assigned. | Assignments
|  | testClass : TestClass The test class that contains the theory. | Assignments
|  | unassigned : Array An array of ParameterSignatures that not been assigned values. | Assignments

Public Methods

| Method | Defined By
--- | --- | ---
|  | Assignments(assigned:Array, unassigned:Array, testClass:TestClass) Constructor. | Assignments
|  | allUnassigned(method:Method, testClass:TestClass):Assignments [static] This is perhaps a tad bit more complicated than really needed for AS. | Assignments
|  | assignNext(source:IPotentialAssignment):Assignments Creates a new Assignments consiting of the assigned array containing the new source and the the array of still unassigned ParameterSignatures minus the first element which was just assigned. | Assignments
|  | getActualValues(start:int, stop:int, nullsOk:Boolean):Array Returns an array of values from IPotentialAssignments ranging from the start poisition to the stop position in the assigned array. | Assignments
|  | getAllArguments(nullsOk:Boolean):Array Retrieves an array of all arguments from the assigned array. | Assignments
|  | getAnnotatedSupplier(unassigned:ParameterSignature):IParameterSupplier Retrieves an object that implements IParameterSupplier that can be used to obtain potential values for the provided ParameterSignature. | Assignments
|  | getArgumentStrings(nullsOk:Boolean):Array Returns an array of descriptions for all currently assigned IPotentialAssignments. | Assignments
|  | getConstructorArguments(nullsOk:Boolean):Array Retrieves an array of constructor arguments from the assigned array. | Assignments
|  | getMethodArguments(nullsOk:Boolean):Array Retrieves an array of method arguments from the assigned array. | Assignments
|  | getSupplier(unassigned:ParameterSignature):IParameterSupplier Retrieves an object that implements IParameterSupplier that can be used to obtain potential values for the provided ParameterSignature. | Assignments
|  | nextUnassigned():ParameterSignature Returns the next unassigned ParameterSignature. | Assignments
|  | potentialsForNextUnassigned():Array Retrieves the potential values that the next unassigned ParameterSignature can use. | Assignments
|  | toString():String Returns a string containing the name of the test class, the assigned parameters, and the unassigned parameters. | Assignments

Property Detail

assigned | property

`public var assigned:Array`

An array of `IPotentialAssignment`s that have been assigned values.

complete | property |

`complete:Boolean` [read-only]

Returns a Boolean value indicating whether all unassigned values have been assigned.

Implementation
`public function get complete():Boolean`

testClass | property |

`public var testClass:TestClass`

The test class that contains the theory.

unassigned | property |

`public var unassigned:Array`

An array of `ParameterSignature`s that not been assigned values.

Constructor Detail

Assignments | () | Constructor

`public function Assignments(assigned:Array, unassigned:Array, testClass:TestClass)`

Constructor.

Parameters

| `assigned:Array` — An array of `IPotentialAssignment`s that have been assigned values.
| `unassigned:Array` — An array of `ParameterSignature`s that not been assigned values.
| `testClass:TestClass` — The test class that contains the theory.

Method Detail

allUnassigned | () | method

`public static function allUnassigned(method:Method, testClass:TestClass):Assignments`

This is perhaps a tad bit more complicated than really needed for AS. The java version really needs to worry about multiple method signatures including multiple constructor signatures. No such worries here, but the basic flow was kept the same to be relatable and cause... who knows what the future could bring.

Parameters

| `method:Method` — The current theory method.
| `testClass:TestClass` — The test class that contains the method.

Returns

| `Assignments` — an `Assignments` that contains all unassigned `ParameterSignature` that need to be assigned before a theory method test can be run.

assignNext | () | method |

`public function assignNext(source:IPotentialAssignment):Assignments`

Creates a new `Assignments` consiting of the assigned array containing the new source and the the array of still unassigned `ParameterSignature`s minus the first element which was just assigned.

Parameters

| `source:IPotentialAssignment` — The new `IPotentialAssignment` to add.

Returns

| `Assignments` — an new `Assignments` with one more assigned parameter and one fewer unassigned parameters.

getActualValues | () | method |

`public function getActualValues(start:int, stop:int, nullsOk:Boolean):Array`

Returns an array of values from `IPotentialAssignment`s ranging from the start poisition to the stop position in the assigned array.

Parameters

| `start:int` — The starting position in the assigned array.
| `stop:int` — The ending position in the assigned array.
| `nullsOk:Boolean` — A Boolean value indicating whether a null value is acceptable. If a null values are not ok, a `CouldNotGenerateValueException` will be thrown.

Returns

| `Array` — An array of values from `IPotentialAssignment`s ranging from the start poisition to the stop position in the assigned array.

Throws

| `CouldNotGenerateValueException` — if a value of null is encountered a nulls are not allowed.

getAllArguments | () | method |

`public function getAllArguments(nullsOk:Boolean):Array`

Retrieves an array of all arguments from the assigned array.

Parameters

| `nullsOk:Boolean` — A Boolean value indicating whether null values are acceptable as an argument.

Returns

| `Array` — an array of all arguments from the assigned array.

getAnnotatedSupplier | () | method |

`public function getAnnotatedSupplier(unassigned:ParameterSignature):IParameterSupplier`

Retrieves an object that implements `IParameterSupplier` that can be used to obtain potential values for the provided `ParameterSignature`.

Parameters

| `unassigned:ParameterSignature` — The parameter signature used to determine the `IParameterSupplier`.

Returns

| `IParameterSupplier` — an object that implements `IParameterSupplier` that can be used to get potential values for the `ParameterSignature`. If no annotated suppliet can be found for the `ParameterSignature`, a value of null is returned.

getArgumentStrings | () | method |

`public function getArgumentStrings(nullsOk:Boolean):Array`

Returns an array of descriptions for all currently assigned `IPotentialAssignment`s.

Parameters

| `nullsOk:Boolean` — A Boolean that indicates whether null values will be accepted.

Returns

| `Array` — an array of descriptions for all currently assigned `IPotentialAssignment`s.

getConstructorArguments | () | method |

`public function getConstructorArguments(nullsOk:Boolean):Array`

Retrieves an array of constructor arguments from the assigned array.

Parameters

| `nullsOk:Boolean` — A Boolean value indicating whether null values are acceptable as an argument.

Returns

| `Array` — an array of constructor arguments from the assigned array.

getMethodArguments | () | method |

`public function getMethodArguments(nullsOk:Boolean):Array`

Retrieves an array of method arguments from the assigned array.

Parameters

| `nullsOk:Boolean` — A Boolean value indicating whether null values are acceptable as an argument.

Returns

| `Array` — an array of method arguments from the assigned array.

getSupplier | () | method |

`public function getSupplier(unassigned:ParameterSignature):IParameterSupplier`

Retrieves an object that implements `IParameterSupplier` that can be used to obtain potential values for the provided `ParameterSignature`.

Parameters

| `unassigned:ParameterSignature` — The parameter signature used to determine the `IParameterSupplier`.

Returns

| `IParameterSupplier` — an object that implements `IParameterSupplier` that can be used to get potential values for the `ParameterSignature`.

nextUnassigned | () | method |

`public function nextUnassigned():ParameterSignature`

Returns the next unassigned `ParameterSignature`.

Returns

| `ParameterSignature`

potentialsForNextUnassigned | () | method |

`public function potentialsForNextUnassigned():Array`

Retrieves the potential values that the next unassigned `ParameterSignature` can use.

Returns

| `Array` — an Array consisting of values that can be potentially used by the next unassigned `ParameterSignature`.

toString | () | method |

`public function toString():String`

Returns a string containing the name of the test class, the assigned parameters, and the unassigned parameters.

Returns

| `String`

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