private void Given()
        {
            _it = new AwakeReaderService();

            _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);

            _correlationId1 = Guid.NewGuid();
            _it.Handle(
                new AwakeReaderServiceMessage.SubscribeAwake(
                    _envelope, _correlationId1, "Stream", new TFPos(1000, 500), _reply1));
            _correlationId2 = Guid.NewGuid();
            _it.Handle(
                new AwakeReaderServiceMessage.SubscribeAwake(
                    _envelope, _correlationId2, "Stream", new TFPos(100000, 99500), _reply2));
            _correlationId3 = Guid.NewGuid();
            _it.Handle(
                new AwakeReaderServiceMessage.SubscribeAwake(
                    _envelope, _correlationId3, "Stream2", new TFPos(1000, 500), _reply3));
            _correlationId4 = Guid.NewGuid();
            _it.Handle(
                new AwakeReaderServiceMessage.SubscribeAwake(
                    _envelope, _correlationId4, null, new TFPos(1000, 500), _reply4));
            _correlationId5 = Guid.NewGuid();
            _it.Handle(
                new AwakeReaderServiceMessage.SubscribeAwake(
                    _envelope, _correlationId5, null, new TFPos(100000, 99500), _reply5));

        }
        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(3);
            _reply3 = new TestMessage(4);

            _it.Handle(_eventCommitted);

        }