Ejemplo n.º 1
0
        public void Test_AddCity_AddCityToFlight()
        {
            Flight testFlight = new Flight("complete", "5 am", "seattle", "los angeles");

            testFlight.Save();

            City city1 = new City("LA");

            city1.Save();

            City city2 = new City("SJ");

            city2.Save();

            testFlight.AddCity(city1);
            testFlight.AddCity(city2);

            List <City> testList = new List <City> {
                city1, city2
            };
            List <City> result = testFlight.GetCities();

            Assert.Equal(testList, result);
        }
Ejemplo n.º 2
0
        public void Test_GetCities_GatAllCities()
        {
            Flight testFlight = new Flight("complete", "5 am", "seattle", "los angeles");

            testFlight.Save();

            City city1 = new City("LA");

            city1.Save();

            City city2 = new City("SJ");

            city2.Save();

            testFlight.AddCity(city1);
            List <City> savedCities = testFlight.GetCities();
            List <City> testList    = new List <City> {
                city1
            };

            Assert.Equal(savedCities, testList);
        }