Exemple #1
0
 public void WaitForSeconds_ZeroSeconds_IsNotValid()
 {
     Assert.Throws <ValidationException>(() =>
                                         StateMachineBuilder.StateMachine()
                                         .StartAt("Initial")
                                         .State("Initial", StateMachineBuilder.WaitState()
                                                .WaitFor(StateMachineBuilder.Seconds(0))
                                                .Transition(StateMachineBuilder.End()))
                                         .Build());
 }
Exemple #2
0
 public void InvalidTransitionInWaitState_IsNotValid()
 {
     Assert.Throws <ValidationException>(() =>
                                         StateMachineBuilder.StateMachine()
                                         .StartAt("Initial")
                                         .State("Initial", StateMachineBuilder.WaitState()
                                                .WaitFor(StateMachineBuilder.Seconds(10))
                                                .Transition(StateMachineBuilder.Next("NoSuchState")))
                                         .Build());
 }
Exemple #3
0
        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");
        }