public void GetCampgroundsByIdTest()
        {
            CampgroundSqlDAO dao = new CampgroundSqlDAO(connectionString);

            IList <Campground> campgroundss = dao.GetCampgroundsByParkId(newParkId);

            Assert.AreEqual(1, campgroundss.Count);
        }
コード例 #2
0
        public void GetCampgroundsTest_Should_ReturnAllCampgrounds()
        {
            // Arrange
            CampgroundSqlDAO dao = new CampgroundSqlDAO(ConnectionString);

            // Act
            IList <Campground> campgrounds = dao.GetCampgroundsByParkId(ParkId);

            // Assert
            Assert.AreEqual(2, campgrounds.Count);
        }
コード例 #3
0
        public void TestGetAllCampgroundsByParkId()
        {
            //Arrange
            CampgroundSqlDAO dao = new CampgroundSqlDAO(connectionString);

            //Act
            IList <Campground> campgrounds = dao.GetCampgroundsByParkId(newParkId);
            int i = 0;

            for (; i < campgrounds.Count; i++)
            {
                if (campgrounds[i].CampgroundId == newCampgroundId)
                {
                    break;
                }
            }

            //Assert
            Assert.AreEqual(1, campgrounds.Count);
            Assert.AreEqual("Big Trees", campgrounds[i].Name);
        }