public void DoesNotThrowAnyException(string location) { //Arrange var cut = new FilmDataDownloaderWebSource(); var parsedJson = new CinemaIdJSONFileSource(); CinemaIdDownloader idDownloader = new CinemaIdDownloader(parsedJson.GetJson()); //Act int id = idDownloader.GetId(location); //Assert Assert.DoesNotThrow(() => cut.Get(id)); //delegat?? }
public void IsGetProperIDWhenTakeDataFromWeb(string location, int properId) { //Arrange var parsedJson = new CinemaIdJSONWebSource(); var cut = new CinemaIdDownloader(parsedJson.GetJson()); //Act int result = cut.GetId(location); //Assert Assert.AreEqual(result, properId); }
/// <summary> /// Method execute procedure of running program in proper order /// </summary> /// <returns>Return string with a repoertoire</returns> public string Execute() { CinemaIdJSONWebSource idJson = new CinemaIdJSONWebSource(); FilmDataDownloaderWebSource filmDataDownloader = new FilmDataDownloaderWebSource(); var idCinemaLocation = idJson.GetJson(); CinemaIdDownloader cinemaIdDownloader = new CinemaIdDownloader(idCinemaLocation); ShowCinemaListsFromJSONFile showCinemaList = new ShowCinemaListsFromJSONFile(); Console.WriteLine(showCinemaList.Execute()); Console.WriteLine("Podaj kino"); var id = cinemaIdDownloader.GetId(Console.ReadLine()); var filmData = filmDataDownloader.Get(id); ResultDisplay resultDisplay = new ResultDisplay(filmData); return(resultDisplay.GenerateResult()); }