Esempio n. 1
0
        public void CanReadFromJsonFile()
        {
            IEnumerable <string> locations = null;

            locations = JsonLocationReader.Cities();
            Assert.IsNotNull(locations);
            Assert.IsTrue(locations.Count() > 0);
        }
Esempio n. 2
0
 public void CanAddCitiesToLocationDb()
 {
     using (LocationDbContext db = new LocationDbContext())
     {
         foreach (string city in JsonLocationReader.Cities())
         {
             Location loc = new Location(city);
             db.locations.Add(loc);
             db.SaveChanges();
         }
     }
 }