1.8 KiB
1.8 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-17T16:14:08.282619+00:00 | zai-org/GLM-5-FP8 | 1 | f3b6a750e8952451 |
StateMachine.Tests
Purpose
This module contains unit tests for a singleton States factory class within the DTS.DASLib.Service.StateMachine namespace. It verifies that the States singleton is correctly initialized, that it maps State enum values to the correct IDASState instances, and that the IDASFactory dependency is properly propagated to all state instances.
Public Interface
StatesShould(TestFixture)void Instance_ShouldNotBeNull(): Verifies that theStates.Instancesingleton property returns a non-null reference.void Instance_ShouldBeSame(): Verifies thatStates.Instancereturns the same reference on subsequent calls (Singleton pattern guarantee).void States_ShouldReturnCorrectInstanceOfState(): Verifies that specific properties on theStatesinstance (e.g.,Arm,Arming,Configure) return objects with the correspondingStateenum value.void GetIDASState_ReturnAllKnownStates(): Iterates through all defined values of theStateenum and verifies thatStates.Instance.GetIDASState(State)returns an object with a matchingStateproperty.void GetIDASState_ShouldThrowException_WithUndefinedState(): Verifies that callingGetIDASStatewith an invalid enum value (cast from integer45) throws anInvalidOperationExceptionwith the message "Undefined State".void SetDASFactory_ShouldSetToAnInstanceOfDASFactory(): Verifies thatStates.SetDASFactory(IDASFactory)correctly injects the factory into all state instances retrieved viaGetIDASState.
Invariants
- Singleton Pattern:
States.Instancemust always return the same object reference.