Exemplo n.º 1
0
        public void GetAvailableSitesParkwideTest()
        {
            // Arrange
            Reservation reservation = new Reservation
            {
                Name      = "Jeeyai Jhoe",
                From_Date = DateTime.Now.AddDays(7),
                To_Date   = DateTime.Now.AddDays(12)
            };

            using (SqlConnection connection = new SqlConnection(ConnectionString))
            {
                SqlCommand command = new SqlCommand(
                    @"SELECT park_id
                      FROM park
                      WHERE name = 'Casa de Jesse'",
                    connection);

                connection.Open();

                parkId = Convert.ToInt32(command.ExecuteScalar());
            }

            // Act and Assert
            Assert.AreEqual(8, (dao.GetAvailableSitesParkwide(parkId, reservation).Count));
            Assert.AreEqual(6, (dao.GetAvailableSitesParkwide(parkId, reservation)[1].Max_Occupancy));
        }