public MockRepositorySpecification()
        {
            StreamNameBuilder     = new PrefixedCamelCaseStreamNameBuilder();
            StreamStoreConnection = new MockStreamStoreConnection("Test");
            StreamStoreConnection.Connect();
            EventSerializer = new JsonMessageSerializer();
            MockRepository  = new StreamStoreRepository(StreamNameBuilder, StreamStoreConnection, EventSerializer);

            var connectorBus = new InMemoryBus("connector");

            StreamStoreConnection.SubscribeToAll(evt => {
                if (evt is ProjectedEvent)
                {
                    return;
                }
                connectorBus.Publish((IMessage)EventSerializer.Deserialize(evt));
            });
            RepositoryEvents = new TestQueue(connectorBus, new[] { typeof(Event) });
        }
 public virtual void ClearQueues()
 {
     RepositoryEvents.Clear();
     TestQueue.Clear();
 }
 protected DispatcherSpecification()
 {
     Dispatcher = new Dispatcher("Fixture Bus", slowMsgThreshold: TimeSpan.FromMilliseconds(500));
     LocalBus   = new Dispatcher("Fixture LocalBus");
     TestQueue  = new TestQueue(Dispatcher, new[] { typeof(Event), typeof(Command) });
 }