/// <summary>
        /// Method deserialize JSON's from website.
        /// </summary>
        /// <returns>Return CinemaLocation type</returns>
        public CinemaLocation GetJson()
        {
            HttpClient client = new HttpClient();
            var        json   = client.GetStringAsync(@"https://multikino.pl/data/locations/").Result;
            var        result = CinemaLocation.FromJson(json);

            return(result);
        }
        /// <summary>
        /// Method deserialize JSON's from file.
        /// </summary>
        /// <returns>Return CinemaLocation type</returns>
        public CinemaLocation GetJson()
        {
            string path2 = new DirectoryInfo(Environment.CurrentDirectory).Parent.Parent.Parent.FullName; // Path to Project Directory
            string path  = Path.Combine(path2, @"Kinoman.Tests\TestFiles\CinemaIDJson.json");             //Path to file directory in project directory
            var    json  = File.ReadAllText(path, Encoding.Default).ToString();
            //Console.WriteLine(json);
            var data = CinemaLocation.FromJson(json);

            return(data);
        }
Exemple #3
0
 /// <summary>
 /// Constructior take as parameter CinemaLocation type which store deserialized JSON with cinemas locations
 /// </summary>
 public CinemaIdDownloader(CinemaLocation venueParsedJson)
 {
     Venue = venueParsedJson;
 }
Exemple #4
0
 public static string ToJson(this CinemaLocation self) => JsonConvert.SerializeObject(self, ConverterCinemaVenue.Settings);