Exemplo n.º 1
0
        public async Task RequestCountryByName_AllReturnedPropertiesAreEqualsToExpected(string countryName)
        {
            string url = TestHelpers.GetCountryByNameUrlBuilder(countryName);

            var response = await url.GetJsonAsync <List <CountryTestModel> >();

            CountryTestModel actualUkraine   = response.First();
            CountryTestModel expectedUkraine = TestHelpers.ConvertJsonToCountryTestModel(ukraineResponseJsonName);

            actualUkraine.Should().BeEquivalentTo(expectedUkraine);
        }
Exemplo n.º 2
0
        public async Task RequestCountryByNameAndFilterByFields_OnlyFilteredFieldsShouldBeReturned(string countryName, string queryName, string queryValues)
        {
            string url =
                TestHelpers.GetCountryByNameUrlBuilder(countryName).SetQueryParam(queryName, queryValues);

            var response = await url.GetJsonAsync <List <CountryTestModel> >();

            CountryTestModel actualUkraine   = response.First();
            CountryTestModel expectedUkraine = TestHelpers.ConvertJsonToCountryTestModel(ukraineResponseWithThreeFieldsOnlyJsonName);

            actualUkraine.Should().BeEquivalentTo(expectedUkraine);
        }