public void ConsumingStarted_WhenStmInConsumingState_Throws(EventStreamConsumerStateMachine stm, int eventCount)
        {
            Receive(stm, eventCount);
            stm.ConsumingStarted();

            Assert.Throws <InvalidOperationException>(() => stm.ConsumingStarted());
        }
        public void ConsumerClosed_WhenStmConsumingState_DoesNotThrow(EventStreamConsumerStateMachine stm, int eventCount)
        {
            Receive(stm, eventCount);

            stm.ConsumingStarted();
            stm.ConsumerClosed();
        }
        public void ConsumingStarted_WhenStmInClosedState_Throws(EventStreamConsumerStateMachine stm)
        {
            stm.ConsumerClosed();

            Assert.Throws <InvalidOperationException>(() => stm.ConsumingStarted());
        }
 private static void Consume(EventStreamConsumerStateMachine stm)
 {
     stm.ConsumingStarted();
     stm.ConsumingCompleted();
 }