private void OnPlayerMovementSelected(Movement movementInstance) { Movement cpuMovement = movementGenerator.GenerateMovement(); RoundResult result = movementInstance.GetResult(cpuMovement); UpdateScore(result); }
public void GeneratesRandomMovement() { MovementGenerator cpu = new MovementGenerator(); Movement generatedMovement = cpu.GenerateMovement(); Assert.IsNotNull(generatedMovement); Assert.IsInstanceOf <Movement> (generatedMovement); }
public void SetUp() { ui = new MyUITest(); displayer = Substitute.For <ScoreDisplayer> (); cpu = Substitute.For <MovementGenerator> (); cpu.GenerateMovement().Returns(new Rock()); game = new Game(ui, displayer, cpu); }
public void CountPlayerWins() { cpu.GenerateMovement().Returns(new Paper()); ui.Selected(new Scissors()); cpu.GenerateMovement().Returns(new Paper()); ui.Selected(new Scissors()); cpu.GenerateMovement().Returns(new Scissors()); ui.Selected(new Paper()); Assert.AreEqual(2, game.PlayerScore); }