public void EventDoesNotExistsInvokesStandardError()
        {
            var errState = new ErrorState();

            var(machine, reg) = SetupCode.CreateForTests(errState);
            var msg = SetupCode.CreateMessage();

            machine.TansformState("not existing", msg);

            Assert.True(errState.WasSet);
        }
        public void EventDoesNotExistsInvokesOverriddenOnError()
        {
            var errState = new ErrorState();

            var(machine, reg) = SetupCode.CreateForTests(errState);
            var msg = SetupCode.CreateMessage();

            machine.TansformState("not existing", msg, () => { errState.WasOverridden = true; /* errState.WasSet = false; */ });

            Assert.False(errState.WasSet);
            Assert.True(errState.WasOverridden);
        }
        public void EventFoundButTypeNotMatchingInvokesStateOnError()
        {
            var errState = new ErrorState();

            var(machine, reg) = SetupCode.CreateForTests(errState);
            var msg = SetupCode.CreateMessage();

            machine.TansformState("no-generic", msg);

            var nonGeneric = reg.First().State as StateMocks.StateWithoutGenerics;

            Assert.NotNull(nonGeneric);

            Assert.True(nonGeneric.ErrorWasSet);
        }