public void HideButtonPressed() { List <Room> currentRooms = houseManager.GetRoomsInUse(); for (int i = 0; i < currentRooms.Count; i++) { //Debug.Log(currentRooms[i]); } List <Employee> currentEmployees = employeeManager.GetHiredEmployees(); for (int i = 0; i < currentEmployees.Count; i++) { Debug.Log(currentEmployees[i]); } for (int i = 0; i < currentlySelectedRooms.Count; i++) { if (!currentRooms.Contains(currentlySelectedRooms[i])) { houseManager.AddRoom(currentlySelectedRooms[i]); GameManager.instance.AddRoom(currentlySelectedRooms[i]); } Debug.Log("Room Added: " + currentlySelectedRooms[i].roomName); } houseUpdatePanel.SetActive(false); gameUIPanel.SetActive(true); GameManager.instance.SetInstructionTextEnabled(false); GameManager.instance.SetRoomLocations(); }
public void TestGetRoomsInUseWhenNoneAreInUse() { Room room1 = new Room(); Room room2 = new Room(); Room room3 = new Room(); System.Collections.Generic.List <Room> rooms = new System.Collections.Generic.List <Room> { room1, room2, room3 }; HouseManager manager = new HouseManager(rooms); System.Collections.Generic.List <Room> roomsInUse = manager.GetRoomsInUse(); Assert.That(roomsInUse, Has.Count.EqualTo(0)); }
public void TestAddRoomNotAvailableForUse() { Room room1 = new Room(); Room room2 = new Room(); Room room3 = new Room(); System.Collections.Generic.List <Room> rooms = new System.Collections.Generic.List <Room> { room1, room2 }; HouseManager manager = new HouseManager(rooms); Assert.Catch(delegate { manager.AddRoom(room3); }); System.Collections.Generic.List <Room> roomsInUse = manager.GetRoomsInUse(); Assert.That(roomsInUse, Has.Count.EqualTo(0)); }
public void TestAddRoomEmptyList() { Room room1 = new Room(); Room room2 = new Room(); Room room3 = new Room(); System.Collections.Generic.List <Room> rooms = new System.Collections.Generic.List <Room> { room1, room2, room3 }; HouseManager manager = new HouseManager(rooms); manager.AddRoom(room1); System.Collections.Generic.List <Room> roomsInUse = manager.GetRoomsInUse(); Assert.That(roomsInUse, Has.Count.EqualTo(1)); }
public void TestRemoveRoomEmptyList() { Room room1 = new Room(); Room room2 = new Room(); Room room3 = new Room(); System.Collections.Generic.List <Room> rooms = new System.Collections.Generic.List <Room> { room1, room2, room3 }; HouseManager manager = new HouseManager(rooms); Assert.Catch(delegate { manager.RemoveRoom(room1); }); System.Collections.Generic.List <Room> roomsInUse = manager.GetRoomsInUse(); Assert.That(roomsInUse, Has.Count.EqualTo(0)); }