コード例 #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");
 }