public StateMachineFactoryTests() { this.core = Mock.Of <IStateMachineCore>(MockBehavior.Strict); this.factory = new StateMachineFactory <string>(new ConcurrentDictionary <string, Func <IStateMachineCore> >(new[] { new KeyValuePair <string, Func <IStateMachineCore> >("TEST", () => this.core) })); }
private static void Configure <TState, TTrigger>(IStateMachineCore <TState, TTrigger> stateMachine, bool throwOnInvalidTriggers = true, bool throwOnInvalidState = true) { if (throwOnInvalidTriggers) { stateMachine.UnhandledTrigger += ExceptionHelper.ThrowInvalidTrigger; } if (throwOnInvalidState) { stateMachine.InvalidState += ExceptionHelper.ThrowInvalidState; } }
public StateMachineTests() { this.core = Mock.Of <IStateMachineCore>(MockBehavior.Strict); this.component = Mock.Of <IStateComponent>(MockBehavior.Strict); }
public StateMachine(IStateMachineCore core) { this.component = core.Component; this.Current = core.InitialStateId; }