private static void AssertSignedRequest(string id, string secret, string expected) { var credentials = new StaticCredentials(id, secret); var request = new Request("https://us-street.api.smartystreets.com/street-address"); credentials.Sign(request); Assert.AreEqual(expected, request.GetUrl()); }
public void TestResponseReturnedCorrectly() { var signer = new StaticCredentials("id", "secret"); var expectedResponse = new Response(200, null); var mockSender = new MockSender(expectedResponse); var sender = new SigningSender(signer, mockSender); var actualResponse = sender.Send(new Request("http://localhost/")); Assert.AreEqual(expectedResponse, actualResponse); }
public void TestSigningOfRequest() { var signer = new StaticCredentials("id", "secret"); var mockSender = new MockSender(null); var sender = new SigningSender(signer, mockSender); sender.Send(new Request("http://localhost/")); var url = mockSender.Request.GetUrl(); Assert.AreEqual("http://localhost/?auth-id=id&auth-token=secret", url); }
public void SetUp() { signer = new StaticCredentials("id", "secret"); }