public void SearchSpacesMenu(Venue venueInfo)
        {
            bool done = false;

            while (!done)
            {
                List <Space> searchResults;
                Console.Write("When do you need the space? Format is MM/DD/YYYY: ");
                try
                {
                    string   dateToBeSplit = Console.ReadLine();
                    string[] splitDates    = dateToBeSplit.Split("/");
                    DateTime startDate     = new DateTime(int.Parse(splitDates[2]), int.Parse(splitDates[0]), int.Parse(splitDates[1]));
                    Console.Write("How many days will you need the space? ");
                    int daysNeeded = int.Parse(Console.ReadLine());
                    Console.Write("How many people will be in attendance? ");
                    int attendeeCount = int.Parse(Console.ReadLine());

                    searchResults = spaceIO.SearchForAvailableSpaces(venueInfo.VenueID, startDate, daysNeeded, attendeeCount);

                    if (searchResults.Count > 0)
                    {
                        Console.WriteLine("\nThe following spaces are available based on your needs:\n");
                        Console.WriteLine("Space #".PadRight(10) + "Name".PadRight(40) +
                                          "Daily Rate".PadRight(13) + "Max Occup.".PadRight(13) +
                                          "Accessible?".PadRight(14) + "Total Cost");
                        foreach (Space searchResult in searchResults)
                        {
                            string accessible = "Yes";
                            if (!searchResult.Accessablity)
                            {
                                accessible = "No";
                            }
                            Console.WriteLine(searchResult.SpaceID.ToString().PadRight(10) +
                                              searchResult.SpaceName.PadRight(40) + "$" +
                                              searchResult.DailyRate.ToString().PadRight(12) +
                                              searchResult.MaxOccupancy.ToString().PadRight(13) +
                                              accessible.PadRight(14) + "$" + searchResult.TotalCost); //JNB added $ before daily rate
                        }
                        ReservationOnSearchMenu(searchResults, attendeeCount, startDate, venueInfo, daysNeeded);
                        done = true;
                    }
                    else
                    {
                        Console.WriteLine("\nNo space availability matching available constraints, would you like to make another search? Y or N? \n");
                        string failureResponse = Console.ReadLine();
                        if (failureResponse == "N")
                        {
                            done = true;
                        }
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine("Invalid entry format, Please try again.");
                }
            }
            PrintMainMenu();
        }
        public void SearchAvailableSpacesTest()
        {
            //Arrange
            SpacesDAL testObj  = new SpacesDAL(connectionString);
            DateTime  testDate = new DateTime(2020, 6, 15);
            int       newId    = 0;

            using (SqlConnection conn = new SqlConnection(connectionString))
            {
                conn.Open();
                string sqlInsertVenue = "INSERT INTO venue (name, city_id, description) VALUES ('ZZZZ', 3, 'XXXX')";
                string sqlInsertSpace = "INSERT INTO space (name, is_accessible, venue_id, daily_rate, max_occupancy, open_from, open_to) VALUES ('RRRR', 0, @venue_id, 350.00, 100000, 2, 10)"
                                        + "INSERT INTO space (name, is_accessible, venue_id, daily_rate, max_occupancy) VALUES ('ZZZZ', 1, @venue_id, 600.00, 100000)";
                string sqlGetInsertedVenueID = "SELECT id FROM Venue WHERE name = 'ZZZZ'";

                SqlCommand cmd   = new SqlCommand(sqlInsertVenue, conn);
                int        count = cmd.ExecuteNonQuery();
                Assert.IsTrue(count > 0);

                cmd = new SqlCommand(sqlGetInsertedVenueID, conn);
                SqlDataReader reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    newId = Convert.ToInt32(reader["id"]);
                }
                reader.Close();

                cmd = new SqlCommand(sqlInsertSpace, conn);
                cmd.Parameters.AddWithValue("@venue_id", newId);
                count = cmd.ExecuteNonQuery();
                Assert.IsTrue(count > 0);
            }

            //Act
            List <Space> result = testObj.SearchForAvailableSpaces(newId, testDate, 1, 99999);

            //Assert
            Assert.AreEqual(2, result.Count);
        }