advancedrei/PortableRest — pull request #18 by rbeauchamp-lendingtree (2014-03-18 03:47:52+00:00)
Title: Added SendAsync<T> which returns a RestResponse so that users can access HttpResponseMessage properties in addition to deserialized content

Implements requested feature from #13

To check the StatusCode:

```csharp
// Setup
var client = new RestClient{ BaseUrl = BaseAddress };
var request = new RestRequest("notsuccess/notfound");

// Execute
var response = await client.SendAsync(request);

// Validate
response.HttpResponseMessage.StatusCode.Should().Be(HttpStatusCode.NotFound);
response.Content.Should().BeNull();
```

To check the StatusCode and also get the deserialized content:

```csharp
// Setup
var client = new RestClient { BaseUrl = BaseAddress };
var request = new RestRequest("api/books");

// Execute
var response = await client.SendAsync>(request);

// Validate
response.HttpResponseMessage.Should().NotBeNull();
response.HttpResponseMessage.StatusCode.Should().Be(HttpStatusCode.OK);
response.Content.Should().NotBeNull();
response.Content.Count().Should().Be(5);
```

This pull request also enhances the unit test infrastructure such that tests can execute RestRequests against a self-hosted server instance. Developers can easily create and test against real server responses.