protected override async Task Given(AllDependencyResolversTestContext context)
        {

            await base.Given(context);

            var clock = new SystemClock();
            var typeProvider = new TestHarnessTypeProvider(new[] {GetType().Assembly}, new[] {GetType().Namespace});
            var serializer = new DataContractSerializer(typeProvider);
            var replyQueueNameSetting = new ReplyQueueNameSetting(
                new ApplicationNameSetting {Value = "TestApplication"},
                new InstanceNameSetting {Value = "TestInstance"});

            var handlerMap = new HandlerMapper(typeProvider).GetFullHandlerMap(typeof (IHandleCommand<>));

            _brokeredMessageFactory = new BrokeredMessageFactory(new MaxLargeMessageSizeSetting(),
                                                                 new MaxSmallMessageSizeSetting(),
                                                                 replyQueueNameSetting,
                                                                 clock,
                                                                 new NullCompressor(),
                                                                 new DispatchContextManager(),
                                                                 new UnsupportedLargeMessageBodyStore(),
                                                                 serializer,
                                                                 typeProvider);

            _commandDispatcher = new CommandMessageDispatcher(_brokeredMessageFactory,
                                                              new SystemClock(),
                                                              Subject,
                                                              new NullInboundInterceptorFactory(),
                                                              new NullLogger(),
                                                              handlerMap);
        }
 private async Task<BrokeredMessage> When(BrokeredMessageFactory brokeredMessageFactory)
 {
     var bigFatObject = new string(Enumerable.Range(0, 256*1024).Select(i => '.').ToArray());
     return await brokeredMessageFactory.Create(bigFatObject);
 }