public async Task FireTriggerAsync_executes_superState_if_currentState_not_successful()
        {
            var sale = new Sale(saleId: 96)
            {
                State = SaleState.ChangeDue
            };
            var stateMachine             = new StateMachine <Sale, SaleState, SaleEvent>(sale1 => sale1.State, (sale1, newState) => sale1.State = newState);
            var openState                = new StateConfiguration <Sale, SaleState, SaleEvent>(SaleState.Open, stateMachine);
            var changeDueState           = new StateConfiguration <Sale, SaleState, SaleEvent>(SaleState.ChangeDue, stateMachine);
            var openStatePayTriggerFired = false;

            openState
            .AddTriggerAction(SaleEvent.Pay, (sale1, _) => { openStatePayTriggerFired = true; return(Task.CompletedTask); })
            .AddTransition(SaleEvent.Pay, SaleState.Complete, name: "openStatePay");
            changeDueState.AddSuperstate(openState);
            var parameters = new ExecutionParameters <Sale, SaleEvent>(SaleEvent.Pay, sale);

            var result = await changeDueState.FireTriggerAsync(parameters);

            Assert.True(openStatePayTriggerFired);
            Assert.True(result.WasTransitioned);
            Assert.Equal(SaleState.Complete, sale.State);
            Assert.Equal(SaleState.Complete, result.CurrentState);
            Assert.Equal(SaleState.ChangeDue, result.PreviousState);
            Assert.Equal(SaleState.ChangeDue, result.StartingState);
            Assert.Equal("openStatePay", result.LastTransitionName);
        }