public void WaitForSeconds_ZeroSeconds_IsNotValid() { Assert.Throws <ValidationException>(() => StateMachineBuilder.StateMachine() .StartAt("Initial") .State("Initial", StateMachineBuilder.WaitState() .WaitFor(StateMachineBuilder.Seconds(0)) .Transition(StateMachineBuilder.End())) .Build()); }
public void InvalidTransitionInWaitState_IsNotValid() { Assert.Throws <ValidationException>(() => StateMachineBuilder.StateMachine() .StartAt("Initial") .State("Initial", StateMachineBuilder.WaitState() .WaitFor(StateMachineBuilder.Seconds(10)) .Transition(StateMachineBuilder.Next("NoSuchState"))) .Build()); }
public void SingleWaitState_WaitForSeconds() { var stateMachine = StateMachineBuilder.StateMachine() .StartAt("InitialState") .State("InitialState", StateMachineBuilder.WaitState() .Comment("My wait state") .InputPath("$.input") .OutputPath("$.output") .WaitFor(StateMachineBuilder.Seconds(10)) .Transition(StateMachineBuilder.Next("NextState"))) .State("NextState", StateMachineBuilder.SucceedState()) .Build(); AssertStateMachine(stateMachine, "SingleWaitStateWithSeconds.json"); }