public void GetGame_GameExists_GotTheCorrectGame()
        {
            int       maxWins = 3;
            Move      move1   = new Move("Rock");
            Move      move2   = new Move("Scissors");
            Move      move3   = new Move("Paper");
            GameRules rules   = new GameRules(maxWins);

            move1.AddKill(move2.Name);
            move2.AddKill(move3.Name);
            move3.AddKill(move1.Name);

            rules.AddMove(move1);
            rules.AddMove(move2);
            rules.AddMove(move3);

            string sessionId = GameSessionManager.StartGame(rules, "player1", "player2");

            //Act
            Game game = GameSessionManager.GetGame(sessionId);

            //Assert
            Assert.AreEqual("player1", game.Player1Name);
            Assert.AreEqual("player2", game.Player2Name);
        }
Пример #2
0
 private Game GetStartedGame(string sessionId)
 {
     return(GameSessionManager.GetGame(sessionId));
 }
 public void GetGame_GameDoesNotExists_ThrowElementNotFoundException()
 {
     //Act
     GameSessionManager.GetGame("NotAGameId");
 }