Example #1
0
        public async Task GzipDisabledNotSupportEndPoint()
        {
            _client.DisableGzip();

            MockServer
            .Given(Request.Create().UsingGet())
            .RespondWith(CreateResponse("{\"name\":\"Tom\"}", "application/json"));

            var user = await _client.GetUsersApi().MeAsync();

            Assert.AreEqual("Tom", user.Name);

            var requestEntry = MockServer.LogEntries.Last();

            Assert.AreEqual($"{MockServerUrl}/api/v2/me", requestEntry.RequestMessage.Url);
            Assert.IsFalse(requestEntry.RequestMessage.Headers.ContainsKey("Content-Encoding"));
            Assert.AreEqual("identity", requestEntry.RequestMessage.Headers["Accept-Encoding"].First());
        }