private void AssertValidRequest(string uri, HttpRequestMessage r, HttpMethod method = null) { if (method == null) { method = HttpMethod.Get; } Assert.AreEqual(r.Method, method); Assert.AreEqual(r.RequestUri.ToString(), client.BaseUrl + uri); Assert.IsNotNull(r.Headers.Authorization); Assert.IsNotNull(r.Headers.UserAgent); Assert.AreEqual(r.Headers.UserAgent.ToString(), client.GetUserAgent()); Assert.AreEqual(r.Headers.Accept.ToString(), "application/json"); }