Esempio n. 1
0
        protected HttpRequestMessage GetRequest(HttpMethod method, string requestUri)
        {
            var request = new HttpRequestMessage(method, requestUri);

            request.Headers.Add("x-pm-apiversion", _apiVersion);
            request.Headers.Add("x-pm-appversion", _appVersion.Value());
            request.Headers.Add("x-pm-locale", _locale);

            return(request);
        }
Esempio n. 2
0
        public void TestInitialize()
        {
            _logger = Substitute.For <ILogger>();

            _appVersion = Substitute.For <IApiAppVersion>();
            _appVersion.Value().Returns(string.Empty);

            _tokenStorage = Substitute.For <ITokenStorage>();
            _tokenStorage.AccessToken.Returns(string.Empty);
            _tokenStorage.Uid.Returns(string.Empty);

            _httpClient             = _fakeHttpMessageHandler.ToHttpClient();
            _httpClient.BaseAddress = new Uri("http://127.0.0.1");

            _apiClient = new ApiClient(_httpClient, _httpClient, _logger, _tokenStorage, _appVersion, null, string.Empty);
        }