Ejemplo n.º 1
0
        public void The_transitions_should_work()
        {
            ExampleStateMachine example = new ExampleStateMachine();

            example.SubmitOrder();

            Assert.AreEqual(ExampleStateMachine.WaitingForPayment, example.CurrentState);

            example.SubmitPayment();

            Assert.AreEqual(ExampleStateMachine.WaitingForPaymentApproval, example.CurrentState);

            example.ApprovePayment();

            Assert.AreEqual(ExampleStateMachine.Completed, example.CurrentState);
        }