public void handle_chain_finished()
        {
            MessageHistory.StartListening();

            var @event = new ChainExecutionStarted
            {
                ChainId = Guid.NewGuid(),
                Envelope = new EnvelopeToken()
            };

            var messageWatcher = new MessageWatcher();
            messageWatcher.Handle(@event);

            var finished = new ChainExecutionFinished
            {
                ChainId = @event.ChainId,
                Envelope = @event.Envelope
            };

            messageWatcher.Handle(finished);

            var received = MessageHistory.Received().Single();
            received.Id.ShouldBe(@event.Envelope.CorrelationId);
            received.Description.ShouldBe(finished.ToString());
            received.Type.ShouldBe(MessageWatcher.MessageTrackType);

            MessageHistory.Outstanding().Any().ShouldBeFalse();
        }
        public void handle_chain_started()
        {
            MessageHistory.ClearHistory();

            var @event = new ChainExecutionStarted
            {
                ChainId = Guid.NewGuid(), Envelope = new EnvelopeToken()
            };

            var sent = @event.ToMessageTrack();
            sent.Id.ShouldBe(@event.Envelope.CorrelationId);
            sent.Description.ShouldBe(@event.ToString());
            sent.Type.ShouldBe(MessageLogRecord.MessageTrackType);
        }
        public void handle_chain_started()
        {
            MessageHistory.StartListening();

            var @event = new ChainExecutionStarted
            {
                ChainId = Guid.NewGuid(), Envelope = new EnvelopeToken()
            };

            new MessageWatcher().Handle(@event);

            var sent = MessageHistory.Outstanding().Single();
            sent.Id.ShouldBe(@event.Envelope.CorrelationId);
            sent.Description.ShouldBe(@event.ToString());
            sent.Type.ShouldBe(MessageWatcher.MessageTrackType);
        }
        public void handle_chain_finished()
        {
            MessageHistory.ClearHistory();

            var @event = new ChainExecutionStarted
            {
                ChainId = Guid.NewGuid(),
                Envelope = new EnvelopeToken()
            };

            var finished = new ChainExecutionFinished
            {
                ChainId = @event.ChainId,
                Envelope = @event.Envelope
            };

            var received = finished.ToMessageTrack();
            received.Id.ShouldBe(@event.Envelope.CorrelationId);
            received.Description.ShouldBe(finished.ToString());
            received.Type.ShouldBe(MessageLogRecord.MessageTrackType);

            MessageHistory.Outstanding().Any().ShouldBeFalse();
        }