Exemplo n.º 1
0
        /// <summary>
        /// Get the City corresponding to the given cityname and country.
        /// If city is an empty string, returns the default city.
        /// </summary>
        private City GetCity(string cityname, string country)
        {
            City target = null;

            if (cityname == "" && country == "")
            {
                target = Cities.Get();
            }
            else if (country == "")
            {
                target = Cities.Get(cityname);
            }
            else
            {
                target = Cities.Get(cityname, country);
            }
            return(target);
        }
Exemplo n.º 2
0
        public static SettingsModel Get()
        {
            var s = new SettingsModel();

            s.Cities      = Cities.Get();
            s.Immersive   = Immersive.Get();
            s.Preferences = Preferences.Get();
            var init = LocalSettingsHelper.ReadSettingsValue("Inited");

            if (init == null)
            {
                s.Inited = false;
            }
            else
            {
                s.Inited = true;
            }
            return(s);
        }
        public void Main()
        {
            //Retrieves all the cities from the json file.
            List <City> citiesGroup = Cities.Get();

            bool keyCityCheck = false;

            // Checks for a key city.
            foreach (Cities.City singleCity in citiesGroup)
            {
                if (singleCity.Name.ToLower() == "darlington")
                {
                    keyCityCheck = true;
                    break;
                }
            }

            Assert.AreEqual(keyCityCheck, true);
        }