示例#1
0
        public void GetAllSurveysTest()
        {
            ParkServiceSqlDAL        test        = new ParkServiceSqlDAL(_connectionString);
            List <SurveyResultModel> testSurveys = test.GetAllSurveys();

            Assert.IsNotNull(testSurveys);
        }
示例#2
0
        public void GetSingleParkTest()
        {
            ParkServiceSqlDAL test = new ParkServiceSqlDAL(_connectionString);
            Park testPark          = test.GetSinglePark(parkID);

            Assert.IsNotNull(testPark);
        }
示例#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
        }
示例#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);
        }
示例#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);
        }