public async Task DeserializeResponseAsync_WrongUrl() { var client = new HttpClient(); var response = await client.GetAsync("https://services.odata.org/TripPinRESTierService/Robert"); var(Result, ErrorContent) = await response.DeserializeResponseAsync <dynamic>(); ErrorContent.Should().NotBeNullOrEmpty(); //Result.Should().BeNull(); }
public async Task DeserializeResponseAsync_SingleEntity() { var client = new HttpClient(); var response = await client.GetAsync("https://services.odata.org/TripPinRESTierService/People"); var(Result, ErrorContent) = await response.DeserializeResponseAsync <ODataV4List <ExpandoObject> >(); ErrorContent.Should().BeNullOrEmpty(); Result.Should().NotBeNull(); }
public async Task SingleEntity_DeserializesProperly() { var client = new HttpClient(); var response = await client.GetAsync("https://services.odata.org/TripPinRESTierService/People('russellwhyte')"); var(Result, ErrorContent) = await response.DeserializeResponseAsync <ODataV4PrimitiveResult <ExpandoObject> >(); ErrorContent.Should().BeNullOrEmpty(); Result.Should().NotBeNull(); Result.ODataContext.Should().NotBeNullOrWhiteSpace(); }
public async Task ListWithCount_DeserializesProperly() { var client = new HttpClient(); var response = await client.GetAsync("https://services.odata.org/TripPinRESTierService/People?$count=true"); var(Result, ErrorContent) = await response.DeserializeResponseAsync <ODataV4List <ExpandoObject> >(); ErrorContent.Should().BeNullOrEmpty(); Result.Should().NotBeNull(); Result.ODataCount.Should().NotBe(0); Result.ODataCount.Should().Be(Result.Items.Count); Result.ODataContext.Should().NotBeNullOrWhiteSpace(); }