Exemplo n.º 1
0
        /// <summary>
        /// Function takes id of cinema and return Cinema type with repertoir for introduced id
        /// </summary>
        /// <param name="cinemaId">Id of cinema. Possible to take with CinemaIdDownloader class. cinemaID is used for
        /// aproach proper link with cinemas repertooir</param>
        /// <returns>Return Cinema type</returns>
        public Cinema Get(int cinemaId)
        {
            HttpClient client = new HttpClient();
            var        json   = client.GetStringAsync($@"https://multikino.pl/data/filmswithshowings/{cinemaId}").Result;
            Cinema     result = Cinema.FromJson(json);

            return(result);
        }
        /// <summary>
        /// Function takes id of cinema and return Cinema type with repertoir for introduced id
        /// </summary>
        /// <param name="cinemaId">Id of cinema. Possible to take with CinemaIdDownloader class</param>
        /// <returns>Return Cinema type</returns>
        public Cinema Get(int cinemaId)
        {
            string path2  = new DirectoryInfo(Environment.CurrentDirectory).Parent.Parent.Parent.FullName; // Path to Project Directory
            string path   = Path.Combine(path2, $@"Kinoman.Tests\TestFiles\cinema_{cinemaId}.json");       //Path to file directory in project directory
            var    json   = File.ReadAllText(path, Encoding.UTF8).ToString();                              //To string added
            Cinema result = Cinema.FromJson(json);

            return(result);
        }