Skip to content

Commit 214cc0a

Browse files
Added Shuffle and Random Operation and Reorganized Functional Tests (#147)
* Added Shuffle and Random Operation and Reorganized Functional Tests This commit adds two new operations, Shuffle (List) and Random (List or Number). Random will return a random item from a list, or a random whole number from 0 to to the specified numeric value. Also added a NewKeyedList utility and fixed many .ToArray() references to save characters. I also re-organized all of the Functional Tests by functional area and moved BlockHandlerTests into this folder. Lastly, split out Ternary and Color Comparison Tests
1 parent cc73cea commit 214cc0a

File tree

88 files changed

+250
-113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+250
-113
lines changed

EasyCommands.Tests/EasyCommands.Tests.csproj

Lines changed: 71 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -142,49 +142,52 @@
142142
<Compile Include="ParameterParsingTests\SimpleVariableParameterProcessorTests.cs" />
143143
<Compile Include="ParameterParsingTests\AggregateBlockPropertyProcessorTests.cs" />
144144
<Compile Include="ParameterParsingTests\TransferCommandProcessorTests.cs" />
145-
<Compile Include="ScriptTests\BlockHandlerTests\AirVentBlockTests.cs" />
146-
<Compile Include="ScriptTests\BlockHandlerTests\BeaconBlockTests.cs" />
147-
<Compile Include="ScriptTests\BlockHandlerTests\CryoChamberBlockTests.cs" />
148-
<Compile Include="ScriptTests\BlockHandlerTests\GasTankBlockTests.cs" />
149-
<Compile Include="ScriptTests\BlockHandlerTests\ProjectorBlockTests.cs" />
150-
<Compile Include="ScriptTests\BlockHandlerTests\MergeBlockTests.cs" />
151-
<Compile Include="ScriptTests\BlockHandlerTests\MagnetBlockTests.cs" />
152-
<Compile Include="ScriptTests\BlockHandlerTests\LandingGearBlockTests.cs" />
153-
<Compile Include="ScriptTests\BlockHandlerTests\SoundBlockTests.cs" />
154-
<Compile Include="ScriptTests\BlockHandlerTests\ThrustBlockTests.cs" />
155-
<Compile Include="ScriptTests\BlockHandlerTests\ProgramBlockTests.cs" />
156-
<Compile Include="ScriptTests\BlockHandlerTests\DoorBlockTests.cs" />
157-
<Compile Include="ScriptTests\BlockHandlerTests\RemoteControlBlockTests.cs" />
158-
<Compile Include="ScriptTests\BlockHandlerTests\CockpitBlockTests.cs" />
159-
<Compile Include="ScriptTests\BlockHandlerTests\ParachuteBlockTests.cs" />
160-
<Compile Include="ScriptTests\BlockHandlerTests\OreDetectorTests.cs" />
161-
<Compile Include="ScriptTests\BlockHandlerTests\BatteryBlockTests.cs" />
162-
<Compile Include="ScriptTests\BlockHandlerTests\SolarPanelBlockTests.cs" />
163-
<Compile Include="ScriptTests\BlockHandlerTests\ReactorBlockTests.cs" />
164-
<Compile Include="ScriptTests\BlockHandlerTests\FunctionalBlockTests.cs" />
165-
<Compile Include="ScriptTests\BlockHandlerTests\WindTurbineBlockTests.cs" />
166-
<Compile Include="ScriptTests\BlockHandlerTests\WheelBlockTests.cs" />
167-
<Compile Include="ScriptTests\BlockHandlerTests\TerminalBlockTests.cs" />
168-
<Compile Include="ScriptTests\BlockHandlerTests\RefineryBlockTests.cs" />
169-
<Compile Include="ScriptTests\FunctionalTests\BlockCommandTests.cs" />
170-
<Compile Include="ScriptTests\BlockHandlerTests\GasGeneratorBlockTests.cs" />
171-
<Compile Include="ScriptTests\BlockHandlerTests\LaserAntennaBlockTests.cs" />
172-
<Compile Include="ScriptTests\BlockHandlerTests\CargoBlockTests.cs" />
173-
<Compile Include="ScriptTests\BlockHandlerTests\ConnectorBlockTests.cs" />
174-
<Compile Include="ScriptTests\BlockHandlerTests\JumpDriveBlockTests.cs" />
175-
<Compile Include="ScriptTests\FunctionalTests\ControlCommandTests.cs" />
176-
<Compile Include="ScriptTests\FunctionalTests\IterationCommandTests.cs" />
177-
<Compile Include="ScriptTests\FunctionalTests\SimpleWaitCommandTests.cs" />
178-
<Compile Include="ScriptTests\FunctionalTests\SimpleComparisonsOtherTests.cs" />
179-
<Compile Include="ScriptTests\FunctionalTests\SimpleAggregationTests.cs" />
180-
<Compile Include="ScriptTests\FunctionalTests\SimpleColorTests.cs" />
181-
<Compile Include="ScriptTests\FunctionalTests\SimpleVectorTests.cs" />
182-
<Compile Include="ScriptTests\FunctionalTests\SimpleCastTests.cs" />
183-
<Compile Include="ScriptTests\FunctionalTests\SimpleComparisonsBooleanTests.cs" />
184-
<Compile Include="ScriptTests\FunctionalTests\SimpleComparisonsNumberTests.cs" />
185-
<Compile Include="ScriptTests\FunctionalTests\SimpleComparisonsStringTests.cs" />
186-
<Compile Include="ScriptTests\FunctionalTests\SimpleComparisonsVectorTests.cs" />
187-
<Compile Include="ScriptTests\FunctionalTests\SimpleComparisonsListTests.cs" />
145+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\AirVentBlockTests.cs" />
146+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\BeaconBlockTests.cs" />
147+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\CryoChamberBlockTests.cs" />
148+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\GasTankBlockTests.cs" />
149+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\ProjectorBlockTests.cs" />
150+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\MergeBlockTests.cs" />
151+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\MagnetBlockTests.cs" />
152+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\LandingGearBlockTests.cs" />
153+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\SoundBlockTests.cs" />
154+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\ThrustBlockTests.cs" />
155+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\ProgramBlockTests.cs" />
156+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\DoorBlockTests.cs" />
157+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\RemoteControlBlockTests.cs" />
158+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\CockpitBlockTests.cs" />
159+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\ParachuteBlockTests.cs" />
160+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\OreDetectorTests.cs" />
161+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\BatteryBlockTests.cs" />
162+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\SolarPanelBlockTests.cs" />
163+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\ReactorBlockTests.cs" />
164+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\FunctionalBlockTests.cs" />
165+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\WindTurbineBlockTests.cs" />
166+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\WheelBlockTests.cs" />
167+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\TerminalBlockTests.cs" />
168+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\RefineryBlockTests.cs" />
169+
<Compile Include="ScriptTests\FunctionalTests\Commands\BlockCommandTests.cs" />
170+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\GasGeneratorBlockTests.cs" />
171+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\LaserAntennaBlockTests.cs" />
172+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\CargoBlockTests.cs" />
173+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\ConnectorBlockTests.cs" />
174+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\JumpDriveBlockTests.cs" />
175+
<Compile Include="ScriptTests\FunctionalTests\Commands\ControlCommandTests.cs" />
176+
<Compile Include="ScriptTests\FunctionalTests\Commands\IterationCommandTests.cs" />
177+
<Compile Include="ScriptTests\FunctionalTests\Operations\SimpleRandomTests.cs" />
178+
<Compile Include="ScriptTests\FunctionalTests\Operations\SimpleShuffleTests.cs" />
179+
<Compile Include="ScriptTests\FunctionalTests\Operations\TernaryOperatorTests.cs" />
180+
<Compile Include="ScriptTests\FunctionalTests\Commands\SimpleWaitCommandTests.cs" />
181+
<Compile Include="ScriptTests\FunctionalTests\Operations\Comparisons\SimpleComparisonsColorTests.cs" />
182+
<Compile Include="ScriptTests\FunctionalTests\Variables\SimpleAggregationTests.cs" />
183+
<Compile Include="ScriptTests\FunctionalTests\Primitives\SimpleColorTests.cs" />
184+
<Compile Include="ScriptTests\FunctionalTests\Primitives\SimpleVectorTests.cs" />
185+
<Compile Include="ScriptTests\FunctionalTests\Operations\SimpleCastTests.cs" />
186+
<Compile Include="ScriptTests\FunctionalTests\Operations\Comparisons\SimpleComparisonsBooleanTests.cs" />
187+
<Compile Include="ScriptTests\FunctionalTests\Operations\Comparisons\SimpleComparisonsNumberTests.cs" />
188+
<Compile Include="ScriptTests\FunctionalTests\Operations\Comparisons\SimpleComparisonsStringTests.cs" />
189+
<Compile Include="ScriptTests\FunctionalTests\Operations\Comparisons\SimpleComparisonsVectorTests.cs" />
190+
<Compile Include="ScriptTests\FunctionalTests\Operations\Comparisons\SimpleComparisonsListTests.cs" />
188191
<Compile Include="ScriptTests\MockEntityUtility.cs" />
189192
<Compile Include="ScriptTests\ExampleScriptTests\ReverseSirensTests.cs" />
190193
<Compile Include="ParameterParsingTests\BlockCommandProcessorTests.cs" />
@@ -194,38 +197,38 @@
194197
<Compile Include="ParameterParsingTests\SelectorLogicParameterProcessorTests.cs" />
195198
<Compile Include="ParameterParsingTests\SimpleCommandProcessorTests.cs" />
196199
<Compile Include="Properties\AssemblyInfo.cs" />
197-
<Compile Include="ScriptTests\BlockHandlerTests\HingeBlockTests.cs" />
200+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\HingeBlockTests.cs" />
198201
<Compile Include="ScriptTests\ScriptTest.cs" />
199-
<Compile Include="ScriptTests\FunctionalTests\SimpleCommandExecutionTests.cs" />
200-
<Compile Include="ScriptTests\BlockHandlerTests\LightBlockTests.cs" />
202+
<Compile Include="ScriptTests\FunctionalTests\Commands\SimpleCommandExecutionTests.cs" />
203+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\LightBlockTests.cs" />
201204
<Compile Include="ScriptTests\FunctionalTests\MultiThreadingTests.cs" />
202-
<Compile Include="ScriptTests\BlockHandlerTests\RotorBlockTests.cs" />
203-
<Compile Include="ScriptTests\BlockHandlerTests\CameraBlockTests.cs" />
204-
<Compile Include="ScriptTests\BlockHandlerTests\SensorBlockTests.cs" />
205-
<Compile Include="ScriptTests\BlockHandlerTests\PistonBlockTests.cs" />
205+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\RotorBlockTests.cs" />
206+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\CameraBlockTests.cs" />
207+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\SensorBlockTests.cs" />
208+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\PistonBlockTests.cs" />
206209
<Compile Include="ScriptTests\ExampleScriptTests\ShipProximityTests.cs" />
207-
<Compile Include="ScriptTests\FunctionalTests\SimpleSelectorTests.cs" />
208-
<Compile Include="ScriptTests\FunctionalTests\SimpleListTests.cs" />
209-
<Compile Include="ScriptTests\BlockHandlerTests\SorterBlockTests.cs" />
210-
<Compile Include="ScriptTests\BlockHandlerTests\TextSurfaceBlockTests.cs" />
211-
<Compile Include="ScriptTests\FunctionalTests\SubclassBlockTests.cs" />
210+
<Compile Include="ScriptTests\FunctionalTests\Selectors\SimpleSelectorTests.cs" />
211+
<Compile Include="ScriptTests\FunctionalTests\Primitives\SimpleListTests.cs" />
212+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\SorterBlockTests.cs" />
213+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\TextSurfaceBlockTests.cs" />
214+
<Compile Include="ScriptTests\FunctionalTests\Selectors\SubclassBlockTests.cs" />
212215
<Compile Include="ScriptTests\ExampleScriptTests\RocketVolleyTests.cs" />
213216
<Compile Include="ScriptTests\FunctionalTests\SimpleLoggingTests.cs" />
214-
<Compile Include="ScriptTests\BlockHandlerTests\TurretBlockTests.cs" />
215-
<Compile Include="ScriptTests\BlockHandlerTests\GyroscopeBlockTests.cs" />
217+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\TurretBlockTests.cs" />
218+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\GyroscopeBlockTests.cs" />
216219
<Compile Include="ScriptTests\ExampleScriptTests\RotorControlTests.cs" />
217220
<Compile Include="ScriptTests\ExampleScriptTests\AirLockManagerTests.cs" />
218-
<Compile Include="ScriptTests\BlockHandlerTests\GravityBlockTests.cs" />
219-
<Compile Include="ScriptTests\FunctionalTests\SimpleVariableTests.cs" />
220-
<Compile Include="ScriptTests\FunctionalTests\ItemTransferCommandTests.cs" />
221-
<Compile Include="ScriptTests\BlockHandlerTests\TimerBlockTests.cs" />
222-
<Compile Include="ScriptTests\BlockHandlerTests\AssemblerBlockTests.cs" />
223-
<Compile Include="ScriptTests\BlockHandlerTests\EngineBlockTests.cs" />
224-
<Compile Include="ScriptTests\BlockHandlerTests\CollectorBlockTests.cs" />
225-
<Compile Include="ScriptTests\BlockHandlerTests\EjectorBlockTests.cs" />
226-
<Compile Include="ScriptTests\BlockHandlerTests\DecoyBlockTests.cs" />
227-
<Compile Include="ScriptTests\BlockHandlerTests\AntennaBlockTests.cs" />
228-
<Compile Include="ScriptTests\BlockHandlerTests\WarheadBlockTests.cs" />
221+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\GravityBlockTests.cs" />
222+
<Compile Include="ScriptTests\FunctionalTests\Variables\SimpleVariableTests.cs" />
223+
<Compile Include="ScriptTests\FunctionalTests\Commands\ItemTransferCommandTests.cs" />
224+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\TimerBlockTests.cs" />
225+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\AssemblerBlockTests.cs" />
226+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\EngineBlockTests.cs" />
227+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\CollectorBlockTests.cs" />
228+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\EjectorBlockTests.cs" />
229+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\DecoyBlockTests.cs" />
230+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\AntennaBlockTests.cs" />
231+
<Compile Include="ScriptTests\FunctionalTests\BlockHandlers\WarheadBlockTests.cs" />
229232
<Compile Include="TokenParsingTests\BracketParsingTests.cs" />
230233
<Compile Include="TokenParsingTests\StringParsingTests.cs" />
231234
<Compile Include="TokenParsingTests\ParenthesisParsingTests.cs" />

0 commit comments

Comments
 (0)