public void ListSpectatableGamesTestSad() { //delete all users and games, register user1 //RestartSystem(); int id = SetupUser1(); var spectateableGamesBefore = GameBridge.ListSpectateableRooms(); int numBefore = spectateableGamesBefore == null ? 0 : spectateableGamesBefore.Count; int roomId = GameBridge.CreateGameRoomWithPref(id, 10, false, GameMode.Limit, 2, 8, 1, 1); Assert.True(roomId != -1); var spectateableGamesAfter = GameBridge.ListSpectateableRooms(); int numAfter = spectateableGamesBefore == null ? 0 : spectateableGamesAfter.Count; Assert.AreEqual(numBefore, numAfter); CleanUp(roomId); }
public void ListSpectatableGamesTestGood() { //delete all users and games, register user1 //RestartSystem(); SetupUser1(); var games = GameBridge.ListSpectateableRooms(); int numOfGamesBefore = games == null ? 0 : games.Count; int roomId = GameBridge.CreateGameRoomWithPref(UserId, 10, true, GameMode.Limit, 2, 8, 1, 1); Assert.True(roomId != -1); games = GameBridge.ListSpectateableRooms(); int numOfGamesAfter = games == null ? 0 : games.Count; var spec = GameBridge.ListSpectateableRooms(); Assert.AreEqual(numOfGamesBefore + 1, numOfGamesAfter); Assert.True(spec.Exists(game => game.Id == roomId)); CleanUp(roomId); }