public void Reset(ICacheSettingsContainer container = null) { var repository = new RepositoryMock(); repository.RemoveAll(); ApiCacheService = new RealmApiCacheService(repository); ConnectivityService = new ConnectivityMock(); MockHttpMessageHandler = new HttpMessageHandlerMock(); MessageHandler = new CacheMessageHandler(MockHttpMessageHandler, ApiCacheService, ConnectivityService) { CacheSettingsContainer = container }; HttpClient = new HttpClient(MessageHandler); }