Exemplo n.º 1
0
        public void GetAllSurveysTest()
        {
            ParkServiceSqlDAL        test        = new ParkServiceSqlDAL(_connectionString);
            List <SurveyResultModel> testSurveys = test.GetAllSurveys();

            Assert.IsNotNull(testSurveys);
        }
Exemplo n.º 2
0
        public void GetSingleParkTest()
        {
            ParkServiceSqlDAL test = new ParkServiceSqlDAL(_connectionString);
            Park testPark          = test.GetSinglePark(parkID);

            Assert.IsNotNull(testPark);
        }
Exemplo n.º 3
0
        public void GetAllParksTest()
        {
            ParkServiceSqlDAL test     = new ParkServiceSqlDAL(_connectionString);
            List <Park>       parkList = test.GetAllParks();

            Assert.AreEqual(_numberOfParks, parkList.Count);//retrieved the number of rows beforehand to compare to the count in the returned list
        }
Exemplo n.º 4
0
        public void GetForecastByParkCodeTest()
        {
            ParkServiceSqlDAL test     = new ParkServiceSqlDAL(_connectionString);
            List <Park>       parkList = test.GetAllParks();
            Park           firstPark   = parkList[0];
            string         parkID      = firstPark.ParkCode;
            List <Weather> forecast    = test.GetForecastByParkCode(parkID);

            Assert.IsNotNull(forecast);
        }
Exemplo n.º 5
0
        public void SaveNewSurveyTest()
        {
            ParkServiceSqlDAL test   = new ParkServiceSqlDAL(_connectionString);
            Survey            survey = new Survey();

            survey.ActivityLevel = "active";
            survey.Email         = "*****@*****.**";
            survey.ParkCode      = parkID;
            survey.State         = "OH";
            bool worked = test.SaveNewSurvey(survey);

            Assert.IsTrue(worked);
        }