public void spectateFailesAlreadyPlayTest() { sl.GetGameForPlayers(db.getUserByName("test3").id, 0); sl.joinGame(db.getUserByName("test3").id, 0, 2); object m = sl.GetGameForPlayers(db.getUserByName("test3").id, 0); Assert.AreEqual(m, null); }
public void filterActiveGamesByPotSizeTest() { var user2 = db.getUserById(db.getUserByName("test0").id); sl.GetGameForPlayers(user2.id, 3); sl.GetGameForPlayers(user2.id, 0); Assert.AreEqual(center.filterActiveGamesByPotSize(0).Count, 8); }
private static void GetGameForPlayers(ClientInfo clientInfo, JObject jsonObject) { var gameIdToken = jsonObject["gameId"]; var userIdToken = jsonObject["userId"]; if ((gameIdToken == null) || (gameIdToken.Type != JTokenType.Integer) || (userIdToken == null) || (userIdToken.Type != JTokenType.Integer)) { throw new ArgumentException("Error: Parameters Mismatch at get Game for player"); } var getGameForPlayersResponse = sl.GetGameForPlayers((int)userIdToken, (int)gameIdToken); SendMessage(clientInfo, getGameForPlayersResponse); return; }
public void joinSuccessTest() { object m = sl.GetGameForPlayers(db.getUserByName("test0").id, 4); Assert.IsInstanceOfType(m, typeof(TexasHoldemGame)); Assert.AreEqual(((TexasHoldemGame)m).gameId, 4); }