private void Given()
        {
            _it = new Core.Services.AwakeReaderService.AwakeService();

            var recordFactory = LogFormatHelper <TLogFormat, TStreamId> .RecordFactory;
            var streamId      = LogFormatHelper <TLogFormat, TStreamId> .StreamId;

            _eventRecord = new EventRecord(
                100,
                LogRecord.Prepare(
                    recordFactory, 1500, Guid.NewGuid(), Guid.NewGuid(), 1500, 0, streamId, 99, PrepareFlags.Data,
                    "event", new byte[0], null, DateTime.UtcNow), "Stream");
            _eventCommitted = new StorageMessage.EventCommitted(2000, _eventRecord, isTfEof: true);
            _publisher      = new InMemoryBus("bus");
            _envelope       = new PublishEnvelope(_publisher);
            _handler        = new TestHandler <TestMessage>();
            _publisher.Subscribe(_handler);
            _reply1 = new TestMessage(1);
            _reply2 = new TestMessage(3);
            _reply3 = new TestMessage(4);

            _it.Handle(_eventCommitted);
        }
        private void Given()
        {
            _it = new Core.Services.AwakeReaderService.AwakeService();

            _eventRecord = new EventRecord(
                100,
                new PrepareLogRecord(
                    1500, Guid.NewGuid(), Guid.NewGuid(), 1500, 0, "Stream", 99, DateTime.UtcNow, PrepareFlags.Data,
                    "event", new byte[0], null));
            _eventCommitted = new StorageMessage.EventCommitted(2000, _eventRecord, isTfEof: true);
            _publisher      = new InMemoryBus("bus");
            _envelope       = new PublishEnvelope(_publisher);
            _handler        = new TestHandler <TestMessage>();
            _publisher.Subscribe(_handler);
            _reply1 = new TestMessage(1);
            _reply2 = new TestMessage(2);
            _reply3 = new TestMessage(3);
            _reply4 = new TestMessage(4);
            _reply5 = new TestMessage(5);

            _it.Handle(
                new AwakeServiceMessage.SubscribeAwake(
                    _envelope, Guid.NewGuid(), "Stream", new TFPos(1000, 500), _reply1));
            _it.Handle(
                new AwakeServiceMessage.SubscribeAwake(
                    _envelope, Guid.NewGuid(), "Stream", new TFPos(100000, 99500), _reply2));
            _it.Handle(
                new AwakeServiceMessage.SubscribeAwake(
                    _envelope, Guid.NewGuid(), "Stream2", new TFPos(1000, 500), _reply3));
            _it.Handle(
                new AwakeServiceMessage.SubscribeAwake(
                    _envelope, Guid.NewGuid(), null, new TFPos(1000, 500), _reply4));
            _it.Handle(
                new AwakeServiceMessage.SubscribeAwake(
                    _envelope, Guid.NewGuid(), null, new TFPos(100000, 99500), _reply5));
        }