Exemplo n.º 1
0
        public void IsNotNullWhenIsGetFromWeb()
        {
            //Arrange
            var cut = new CinemaIdJSONWebSource();
            //Act
            var result = cut.GetJson();

            //Assert
            Assert.NotNull(result);
        }
Exemplo n.º 2
0
            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());
        }