public void WhenIGetTokensAsyncIReceiveDeserializedTokens() { var uriOauth = OAuthRequestHandler.OAuthRequestUri; var factory = new TestWebRequestFactory(); factory.RegisterResultForUri(uriOauth.AbsoluteUri, "{\"access_token\": \"<<token>>\"}"); var service = new OAuthService(_configuration, factory); OAuthTokens received = service.GetTokensAsync("code").Result; Assert.IsNotNull(received); Assert.AreEqual("<<token>>", received.AccessToken); }