public void TransitionToGlobalStateWithANonGlobalStateResultsInNonGlobalStateException() { StateMachine.AddState(new StateOne()); StateMachine.AddGlobalState(new StateTwo()); StateMachine.SetInitialState <StateTwo>(); StateMachine.Start(); //Assert Assert.Throws <NonGlobalStateException>(() => StateMachine.TransitionToGlobalState <StateOne>()); }
public void GlobalStateDoesNotNeedASetUpTransitionToMoveToThatStateFromAnyState() { StateMachine.AddState(new StateOne()); StateMachine.AddGlobalState(new StateTwo()); StateMachine.SetInitialState <StateOne>(); StateMachine.Start(); //Act StateMachine.TransitionToGlobalState <StateTwo>(); //Assert Assert.That(StateMachine.CurrentState, Is.TypeOf(typeof(StateTwo))); }
private void CreateGlobalState() { StateMachine.AddGlobalState(new StateOne()); }