Class TestEntityState
- Namespace
- XBullet.EasyTesting.AzureFunctions
- Assembly
- XBullet.EasyTesting.AzureFunctions.dll
Provides serialized, test-controlled state for SDK entity operations.
public sealed class TestEntityState : TaskEntityState
- Inheritance
-
TestEntityState
- Inherited Members
- Extension Methods
Remarks
Share one instance across sequential operations for an entity. Reads deserialize fresh values; changes persist only through SetState. Null deletes state. This is not a transaction or concurrency engine.
Constructors
TestEntityState(object?, DataConverter?)
Creates state with an optional initial value and converter.
public TestEntityState(object? initialState = null, DataConverter? dataConverter = null)
Parameters
initialStateobjectA value to serialize immediately; null means absent state.
dataConverterDataConverterThe converter, or the SDK JSON default.
Properties
HasState
Gets a value indicating whether this entity has state or not yet / anymore.
public override bool HasState { get; }
Property Value
Methods
GetState(Type)
Gets the current state of the entity. This will return null if no state is present, regardless if
type is a value-type or not.
public override object? GetState(Type type)
Parameters
typeTypeThe type to retrieve the state as.
Returns
- object
The entity state.
SetState(object?)
Sets the entity state. Setting of null will delete entity state.
public override void SetState(object? state)
Parameters
stateobjectThe state to set.