Beispiel #1
0
        public void Test_EmptyAtFirst()
        {
            //Arrange, act
            int result = City.GetAll().Count;

            //Assert
            Assert.Equal(0, result);
        }
Beispiel #2
0
        public void Test_DatabaseEmptyAtFirst()
        {
            //Arrange, associated
            int result = City.GetAll().Count;

            //Assert
            Assert.Equal(0, result);
        }
Beispiel #3
0
        public static Dictionary <string, object> ModelMaker()
        {
            Dictionary <string, object> model = new Dictionary <string, object> {
            };

            model.Add("Flights", Flight.GetAll());
            model.Add("Cities", City.GetAll());
            return(model);
        }
Beispiel #4
0
        public void TEST_SaveCityToDB()
        {
            List <City> totalCitys = new List <City> {
            };
            City tempCity          = new City("Seattle");

            totalCitys.Add(tempCity);

            tempCity.Save();
            Assert.Equal(totalCitys, City.GetAll());
        }
Beispiel #5
0
        public void Test_Delete()
        {
            City newCity = new City("Atlanta");

            newCity.Save();

            newCity.Delete();

            List <City> expected = new List <City> {
            };
            List <City> actual   = City.GetAll();

            //Assert
            Assert.Equal(expected, actual);
        }
Beispiel #6
0
        public void Test_Save()
        {
            //Arrange, Act
            City newCity = new City("Atlanta");

            newCity.Save();

            List <City> expected = new List <City> {
                newCity
            };
            List <City> actual = City.GetAll();

            //Assert
            Assert.Equal(expected, actual);
        }
Beispiel #7
0
        public void Test_Save_AssignedIdtoCity()
        {
            //Arrange
            City testCity = new City("Seattle");

            testCity.Save();
            City savedCity = City.GetAll()[0];

            //Act
            int savedId = savedCity.GetId();
            int testId  = testCity.GetId();

            //Assert
            Assert.Equal(testId, savedId);
        }
Beispiel #8
0
        public void Test_Save_SavesToDatabase()
        {
            //Arrange
            City testCity = new City("Seattle");

            //Act
            testCity.Save();
            List <City> actualResult   = City.GetAll();
            List <City> expectedResult = new List <City> {
                testCity
            };

            //Assert
            Assert.Equal(expectedResult, actualResult);
        }
Beispiel #9
0
        public void Test_GetAll_ReturnsListofCities()
        {
            //Arrange
            City firstCity  = new City("Seattle");
            City secondCity = new City("Portland");

            //Act
            firstCity.Save();
            secondCity.Save();

            //Assert
            List <City> actualResult   = City.GetAll();
            List <City> expectedResult = new List <City> {
                secondCity, firstCity
            };

            Assert.Equal(expectedResult, actualResult);
        }
Beispiel #10
0
        public void TEST_CheckDBIsEmpty()
        {
            int result = City.GetAll().Count;

            Assert.Equal(0, result);
        }