コード例 #1
0
ファイル: FormTest.cs プロジェクト: kzmanpreet/RaceGame
        public void TestMethod2()
        {
            RaceForm form   = new RaceForm();
            var      actual = form.punter[1].GuyName;

            Assert.AreNotEqual("Ram", actual);
        }
コード例 #2
0
        private void nextButton_Click(object sender, EventArgs e)
        {
            Character character = Program.character;

            try
            {
                character.Strength     = strengthTextBox.Text;
                character.Dexterity    = dexterityTextBox.Text;
                character.Constitution = constitutionTextBox.Text;
                character.Intelligence = intelligenceTextBox.Text;
                character.Wisdom       = wisdomTextBox.Text;
                character.Charisma     = charismaTextBox.Text;

                if (strengthTextBox.Text == "")
                {
                    throw new Exception();
                }
                if (strengthTextBox.Text == "")
                {
                    throw new Exception();
                }
                if (dexterityTextBox.Text == "")
                {
                    throw new Exception();
                }
                if (constitutionTextBox.Text == "")
                {
                    throw new Exception();
                }
                if (wisdomTextBox.Text == "")
                {
                    throw new Exception();
                }
                if (charismaTextBox.Text == "")
                {
                    throw new Exception();
                }
            }

            catch (Exception)
            {
                MessageBox.Show("Please fill in a valid response or press the Roll button");
                return;
            }

            this.Hide();

            RaceForm raceForm = new RaceForm();

            raceForm.previousForm = this;

            raceForm.Show();
        }