//Test VenueSpaces() public void TestVenueSpaces() { SpaceDAL newSpace = new SpaceDAL(connectionString); //Space testSpace = new Space(99, 99, "TestSpace", false, 1, 12, 1000, 1000); IList <Space> spaceList = newSpace.VenueSpaces(); bool found = false; foreach (Space place in spaceList) { if (place.Name == "TestSpace") { found = true; break; } } Assert.IsTrue(found); }
public void DisplaySpaces() { Console.WriteLine("".PadRight(5) + "Name".PadRight(35) + "Opens on (Month)".PadRight(20) + "Closes on (Month)".PadRight(20) + "Daily Rate".PadRight(15) + "Max. Occupancy"); Console.WriteLine(""); IList <Space> newList = spaceDAL.VenueSpaces(); foreach (Space rooms in newList) { if (venue.Id == rooms.VenueId) { space.Id = rooms.Id; space.Name = rooms.Name; space.OpenMonth = rooms.OpenMonth; space.CloseMonth = rooms.CloseMonth; space.DailyRate = rooms.DailyRate; space.MaxOccupancy = rooms.MaxOccupancy; Console.WriteLine(space.Id + " ".PadRight(5 - space.Id.ToString().Length) + space.Name + " ".PadRight(35 - space.Name.ToString().Length) + space.OpenMonth + " ".PadRight(20 - space.OpenMonth.ToString().Length) + space.CloseMonth + " ".PadRight(20 - space.CloseMonth.ToString().Length) + "$" + space.DailyRate + " ".PadRight(15 - space.DailyRate.ToString().Length) + space.MaxOccupancy); } } }