public void ShouldUseCredentialApplier() { var credentialApplier = new QueryPathCredentialApplier(new Dictionary<string, string> { { "header_auth", "value_auth" } }); var entryPointService = new EntryPointService("http://www.example.com/"); entryPointService.WithCredentialApplier(credentialApplier); entryPointService.Get(); }
public void ShoudApplyParamWithQuery() { var request = (HttpWebRequest) WebRequest.Create("http://example.com/?teste=2"); var dictionary = new Dictionary<string, string> { { "oauth_token", "&%62362374" } }; ICredentialApplier applier = new QueryPathCredentialApplier(dictionary); var newRequest = applier.Apply(request); Assert.AreEqual("http://example.com/?teste=2&oauth_token=%26%2562362374", newRequest.RequestUri.AbsoluteUri, "Should add param and value"); }