Exemplo n.º 1
0
        public void CinemasInCityReturnsProperShowUri(string city)
        {
            var expectedRegexPattern = @"https://epertuar.azurewebsites.net/api/Show/[a-zA-Ząćęłńóśźż\s-]+";
            var actual = ResourceIdentifier.CinemasInCityUri(city);

            Assert.Matches(expectedRegexPattern, actual);
        }
Exemplo n.º 2
0
        public async Task <List <Cinema> > GetCinemasInCity(string city)
        {
            List <Cinema> cinemas = null;
            string        uri     = ResourceIdentifier.CinemasInCityUri(city);

            try
            {
                string dataString = await _httpService.Get(uri);

                cinemas = (List <Cinema>)_converter.FromJson(dataString, typeof(List <Cinema>));
            }
            catch
            {
                return(new List <Cinema>());
            }

            return(cinemas);
        }