예제 #1
0
 public void SetRandomOption()
 {
     string choice = SelectRandomOption();
     RPSGame RPSGame = new RPSGame();
     RPSGame.setComputerSelection(choice);
     Assert.AreSame(RPSGame.ComputerSelection, choice);
 }
예제 #2
0
        public override void SetSelectionRock()
        {
            string s = "";
            do
            {
                s = SelectRandomOption();
            } while (s != "Rock");

            RPSGame RPSGame = new RPSGame();
            RPSGame.setComputerSelection(s);
            Assert.AreSame(RPSGame.ComputerSelection, "Rock");
        }
예제 #3
0
        public override void SetSelectionScissors()
        {
            string s = "";
            do
            {
                s = SelectRandomOption();
            } while (s != "Scissors");

            RPSGame RPSGame = new RPSGame();
            RPSGame.setComputerSelection(s);
            Assert.AreSame(RPSGame.HumanSelection, "Scissors");
        }
예제 #4
0
        /// <summary>
        /// These three methods differ from human selection because I am re-rolling the randomizer until
        /// it's the right value for the test
        /// </summary>
        public override void SetSelectionPaper()
        {
            string s = "";
            do
            {
                s = SetRandomOptionBeatRock();
            } while (s != "Paper");

            RPSGame RPSGame = new RPSGame();
            RPSGame.setComputerSelection(s);
            Assert.AreSame(RPSGame.HumanSelection, "Paper");
        }
예제 #5
0
 public override void SetSelectionScissors()
 {
     RPSGame RPSGame = new RPSGame();
     RPSGame.SetHumanSelection("Scissors");
     Assert.AreSame(RPSGame.HumanSelection, "Scissors");
 }
예제 #6
0
 public override void SetSelectionRock()
 {
     RPSGame RPSGame = new RPSGame();
     RPSGame.SetHumanSelection("Rock");
     Assert.AreSame(RPSGame.HumanSelection, "Rock");
 }
예제 #7
0
 public override void SetSelectionPaper()
 {
     RPSGame RPSGame = new RPSGame();
     RPSGame.SetHumanSelection("Paper");
     Assert.AreSame(RPSGame.HumanSelection, "Paper");
 }