Example #1
0
        public void GetWizardSzls_WhenAllowBlockedNodeIsFalse_ContainsStep1()
        {
            var allowBlockedNode = false;

            var wizardSzls   = StateMachineBuilder.GetWizardSzls(allowBlockedNode);
            var stateMachine = new DemoStateMachine(wizardSzls);

            var program1Action = new BoundAction("Wizard", "Step1");
            var matchingState  = stateMachine.GetStateForAction(program1Action);

            Assert.That(matchingState, Is.Not.Null);
        }
Example #2
0
        public void GetWizardSzls_WhenAllowBlockedNodeIsTrue_NextFrom2IsStep3()
        {
            var wizardSzls       = StateMachineBuilder.GetWizardSzls(allowBlockedNode: true);
            var stateMachine     = new DemoStateMachine(wizardSzls);
            var step2BoundAction = new BoundAction("Wizard", "Step2");
            var step2State       = stateMachine.GetStateForAction(step2BoundAction);

            var nextState            = stateMachine.GetNextState(step2State);
            var nextStateBoundAction = ((ActionableSzl)nextState).BoundAction;

            Assert.That(nextStateBoundAction.Action, Is.EqualTo("Step3"));
        }