public void MoveNext_in_StateMachine_Execute_Action() { XStateMachineDefinition<int, int, int> definitions = MakeSampleStateMachineDefinitions(); var initialPosition = new XStatePosition<int, int, int>(2, 2, 3); var sm = new XStateMachine<int, int, int>(definitions, initialPosition); sm.MoveNext(2, 3); Assert.AreEqual(20, sm.CurrentStatePosition.State); }
public void StateMachine_Can_Run_Approval_WorkFlow() { var workflow = MakeSampleApprovalStateMachineDefinitions(); var position = new XStatePosition<string, string, string>("draft", "requester", "submit-for-approval"); var sm = new XStateMachine<string, string, string>(workflow, position); sm.MoveNext("requester", "submit-for-approval"); Assert.AreEqual("pending-for-approval", sm.CurrentStatePosition.State); }
public void StateMachine_Cannot_Run_Undefined_WorkFlow() { var workflow = MakeSampleApprovalStateMachineDefinitions(); var position = new XStatePosition<string, string, string>("draft", "requester", "submit-for-approval"); var sm = new XStateMachine<string, string, string>(workflow, position); sm.MoveNext("approver", "submit-for-approval"); }