Пример #1
0
        public void generateInitialCities()
        {
            City city1 = new City("Milwaukee", "Wisconsin", "MKE");
            City city2 = new City("Brookfield", "Wisconsin", "BKFD");
            City city3 = new City("Waukesha", "Wisconsin", "WAUK");

            listCity.Add(city1);
            listCity.Add(city2);
            listCity.Add(city3);
        }
Пример #2
0
 public bool AddCity(string name, string location, string ID)
 {
     if (name != "" & name != null & location != "" & location != null & ID != "" & ID != null)
     {
         City city = new City(name, location, ID);
         this.database.Append(city);
         return true;
     }
     else
     { return false; }
 }
 public void Append_SelectAll_City_UnitTest()
 {
     Database database = new Database();
     City city1 = new City("Milwaukee", "WI", "MKE-WI");
     City city2 = new City("Waukesha", "WI", "WAU-WI");
     database.Append(city1);
     database.Append(city2);
     List<City> cityList = database.SelectAllCity();
     Assert.AreSame(cityList[0], city1);
     Assert.AreSame(cityList[1], city2);
     Assert.AreEqual(cityList[0].ID, "MKE-WI");
 }
Пример #4
0
 public void Append(City entry)
 {
     listCity.Add(entry);
 }
Пример #5
0
 public void Remove(City entry)
 {
     listCity.Remove(entry);
 }