public async Task Getting_the_top_1_should_return_1_result() { //Arrange var url = Connection.Url + pageURL + "?$top=1"; //Act string responseBody = await client.GetStringAsync(url); WhiskeyResponse WhiskeyReponse = JsonConvert.DeserializeObject <WhiskeyResponse>(responseBody); //Assert Assert.That(WhiskeyReponse.value.Count, Is.EqualTo(1)); }
public async Task The_reponse_should_be_correct_for_filtering_on_id() { //Arrange var expectedValue = "Whiskey1"; var url = Connection.Url + pageURL + "?$Filter=WhiskeyId eq '" + expectedValue + "'"; //Act string responseBody = await client.GetStringAsync(url); WhiskeyResponse WhiskeyReponse = JsonConvert.DeserializeObject <WhiskeyResponse>(responseBody); //Assert Assert.That(WhiskeyReponse.value[0].WhiskeyId.ToString(), Is.EqualTo(expectedValue)); }
public async Task The_reponse_data_be_correct_for_ordering_by_name_desc() { //Arrange var url = Connection.Url + pageURL + "?$orderby=Name desc"; string responseBody = await client.GetStringAsync(url); WhiskeyResponse WhiskeyResponse = JsonConvert.DeserializeObject <WhiskeyResponse>(responseBody); //Assert Assert.That(WhiskeyResponse.value.Select(o => o.Name), Is.Ordered.Descending .Using((IComparer)StringComparer.OrdinalIgnoreCase)); }