public async Task TestDeserializeCalledWithResponseBodyAsync()
        {
            var response     = new Response(0, Encoding.ASCII.GetBytes("Hello, World!"));
            var mockSender   = new MockSender(response);
            var sender       = new URLPrefixSender("http://localhost/", mockSender);
            var deserializer = new FakeDeserializer(new Result());
            var client       = new Client(sender, deserializer);

            await client.SendAsync(new Lookup("1"));

            Assert.AreEqual(response.Payload, deserializer.Payload);
        }
        public async Task TestResultCorrectlyAssignedToLookupAsync()
        {
            var lookup         = new Lookup("1");
            var expectedResult = new Result();

            var mockSender   = new MockSender(new Response(0, Encoding.ASCII.GetBytes("{[]}")));
            var sender       = new URLPrefixSender("http://localhost/", mockSender);
            var deserializer = new FakeDeserializer(expectedResult);
            var client       = new Client(sender, deserializer);

            await client.SendAsync(lookup);

            Assert.AreEqual(expectedResult.Suggestions, lookup.Result);
        }
 public void Setup()
 {
     this.capturingSender = new RequestCapturingSender();
     this.urlSender       = new URLPrefixSender("http://localhost/", this.capturingSender);
 }