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

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

            Assert.AreEqual(1, campgroundss.Count);
        }
Exemplo n.º 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);
        }
        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);
        }