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)
     }));
 }
Example #2
0
 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;
     }
 }
Example #3
0
 public StateMachineTests()
 {
     this.core      = Mock.Of <IStateMachineCore>(MockBehavior.Strict);
     this.component = Mock.Of <IStateComponent>(MockBehavior.Strict);
 }
Example #4
0
 public StateMachine(IStateMachineCore core)
 {
     this.component = core.Component;
     this.Current   = core.InitialStateId;
 }