Beispiel #1
0
        public void PostSurveyTest()
        {
            // Arrange
            // initializes a new SurveyDAL with the connectionString parameter
            SurveyDAL surveyDal = new SurveyDAL(connectionString);

            // Act
            // creates a new list of surveys and adds a mock survey (never committed
            // to the DB, just used for testing)
            List <Survey> surveys   = new List <Survey>();
            Survey        newSurvey = new Survey()
            {
                ParkCode      = "ZZZ",
                EmailAddress  = "*****@*****.**",
                State         = "Ohio",
                ActivityLevel = "Active"
            };

            // Assert
            // the PostSurvey method returns a bool, so we check to make sure the bool
            // is true, meaning the PostSurvey method has succeeded
            Assert.IsTrue(surveyDal.PostSurvey(newSurvey));
        }