예제 #1
0
        public void Win_For_Paper_Rock()
        {
            var player1 = new Player("player1", new Rock());
            var player2 = new Player("player2", new Paper());

            var game   = new Game(player1, player2);
            var result = game.Play();

            Assert.AreSame(player2, result.Winner);
        }
예제 #2
0
        public void Win_For_Scissors_Paper()
        {
            var player1 = new Player("player1", new Scissors());
            var player2 = new Player("player2", new Paper());

            var game   = new Game(player1, player2);
            var result = game.Play();

            Assert.AreEqual(player1, result.Winner);
        }
예제 #3
0
        public void Draw_For_Scissors_Scissors()
        {
            var player1 = new Player("player1", new Scissors());
            var player2 = new Player("player2", new Scissors());

            var game   = new Game(player1, player2);
            var result = game.Play();

            Assert.True(result.Draw);
            Assert.IsNull(result.Winner);
        }