Exemple #1
0
        public void testPaperScissorExpectScissorsCutPaper()
        {
            Mock <IRockPaperScissorUi> mockUI           = new Mock <IRockPaperScissorUi>();
            RockPaperScissor           rockpaperscissor = new RockPaperScissor(mockUI.Object);
            Player paper   = new Paper(rockpaperscissor);
            Player scissor = new Scissor(rockpaperscissor);

            rockpaperscissor.play(paper, scissor);

            mockUI.Verify(m => m.updateUI("Scissors Cut Paper"));
        }
Exemple #2
0
        public void testRockScissorExpectRockCrushesScissors()
        {
            Mock <IRockPaperScissorUi> mockUI           = new Mock <IRockPaperScissorUi>();
            RockPaperScissor           rockpaperscissor = new RockPaperScissor(mockUI.Object);
            Player rock    = new Rock(rockpaperscissor);
            Player scissor = new Scissor(rockpaperscissor);

            rockpaperscissor.play(rock, scissor);

            mockUI.Verify(m => m.updateUI("Rock Crushes Scissor"));
        }
Exemple #3
0
 public void testRockPaperExpectPaperCoversRock(Player one, Player two, string expected)
 {
     rockpaperscissor.play(one, two);
     static_mockUI.Verify(m => m.updateUI(expected));//FAILS - the call never performs.
 }