Appccelerate.StateMachine.Machine.ExceptionCasesTest.EntryActionWhenThrowingExceptionThenNotificationAndStateIsEntered C# (CSharp) Méthode

EntryActionWhenThrowingExceptionThenNotificationAndStateIsEntered() private méthode

        public void EntryActionWhenThrowingExceptionThenNotificationAndStateIsEntered()
        {
            var eventArguments = new object[] { 1, 2, "test" };
            Exception exception = new Exception();

            this.testee.In(StateMachine.States.A)
                .On(StateMachine.Events.B).Goto(StateMachine.States.B);

            this.testee.In(StateMachine.States.B)
                .ExecuteOnEntry(() =>
                                    {
                                        throw exception;
                                    });

            this.testee.Initialize(StateMachine.States.A);
            this.testee.EnterInitialState();

            this.testee.Fire(StateMachine.Events.B, eventArguments);

            this.AssertException(StateMachine.States.A, StateMachine.Events.B, eventArguments, exception);
            Assert.Equal(StateMachine.States.B, this.testee.CurrentStateId);
        }