Пример #1
0
 public void TestGetContestantList()
 {
     Bee test = new Bee();
     AddQuestions(test, 6);
     AddContestants(test, 3);
     Assert.AreEqual(test.GetConstestantList(), names[0] + System.Environment.NewLine + names[1] + System.Environment.NewLine + names[2] + System.Environment.NewLine);
 }
Пример #2
0
 public void TestAskQuestion()
 {
     Bee test = new Bee();
     AddQuestions(test, 2);
     AddContestants(test, 2);
     test.InitializeBee();
     Assert.AreSame("Texas", test.AskQuestion());
 }
Пример #3
0
 public void TestGetAnswer()
 {
     Bee test = new Bee();
     AddQuestions(test, 2);
     AddContestants(test, 2);
     test.InitializeBee();
     Assert.AreSame("Austin", test.GetAnswer());
 }
Пример #4
0
 public void TestIncorrectAnswer()
 {
     Bee test = new Bee();
     AddQuestions(test, 2);
     AddContestants(test, 2);
     test.RecordAnswer(false);
     Contestant con = test.ContestantList[test.contestant_index-1];
     Assert.IsFalse(con.current_answer_correct);
 }
Пример #5
0
 public void TestEliminateNone()
 {
     Bee test = new Bee();
     AddQuestions(test, 2);
     AddContestants(test, 2);
     test.InitializeBee();
     test.RecordAnswer(false);
     test.RecordAnswer(false);
     Assert.IsTrue(test.CurrentContestant().current_answer_correct == true);
 }
Пример #6
0
 public void TestEliminateOne()
 {
     Bee test = new Bee();
     AddQuestions(test, 3);
     AddContestants(test, 3);
     test.InitializeBee();
     test.RecordAnswer(false);
     test.RecordAnswer(true);
     test.RecordAnswer(true);
     Assert.AreEqual(2, test.ContestantList.Count());
 }
Пример #7
0
 private void AddContestants(Bee test, int num_contestants)
 {
     for ( int i=0; i<num_contestants; i++ )
             test.AddContestant(names[i]);
 }
Пример #8
0
 public void TestSameName()
 {
     Bee test_bee = new Bee();
     Assert.IsTrue(test_bee.AddContestant("Bill"));
     Assert.IsFalse(test_bee.AddContestant("Bill"));
 }
Пример #9
0
 public void TestTooFewQuestionsNextRound()
 {
     Bee test = new Bee();
     AddQuestions(test, 3);
     AddContestants(test, 3);
     test.InitializeBee();
     test.RecordAnswer(false);
     test.RecordAnswer(true);
     test.RecordAnswer(true);
     Assert.IsTrue(test.SufficientQuestions() == false);
 }
Пример #10
0
 public void TestWinner()
 {
     Bee test = new Bee();
     AddQuestions(test, 6);
     AddContestants(test, 3);
     test.InitializeBee();
     test.RecordAnswer(true);
     test.RecordAnswer(false);
     Assert.IsTrue(test.RecordAnswer(false) == true);
 }
Пример #11
0
 public void TestTooFewQuestions()
 {
     Bee test = new Bee();
     AddQuestions(test, 1);
     AddContestants(test, 2);
     Assert.AreEqual(2, test.InitializeBee());
 }
Пример #12
0
 public void TestSkipEliminatedContest()
 {
     Bee test = new Bee();
     AddQuestions(test, 6);
     AddContestants(test, 3);
     test.InitializeBee();
     test.RecordAnswer(false);
     test.RecordAnswer(true);
     test.RecordAnswer(true);
     string con_name = test.CurrentContestant().name;
     Assert.AreSame(names[1], con_name);
 }
Пример #13
0
 public void TestSameQuestion()
 {
     Bee test = new Bee();
     Assert.IsTrue(test.AddQuestion("What is the capitol of texas?", "Austin"));
     Assert.IsFalse(test.AddQuestion("What is the Capitol of Texas?", "Dallas"));
 }
Пример #14
0
 public void TestLoadFiftyStates()
 {
     Bee test = new Bee();
     test.LoadFiftyStates();
     Assert.AreSame(test.QuestionList[49].answer, "Cheyenne");
 }
Пример #15
0
 private void AddQuestions(Bee test, int num_questions)
 {
     for (int i = 0; i < num_questions; i++)
         test.AddQuestion(questions[i, 0], questions[i, 1]);
 }
Пример #16
0
 public void TestNextContestant()
 {
     Bee test = new Bee();
     AddQuestions(test, 2);
     AddContestants(test, 2);
     test.InitializeBee();
     test.RecordAnswer(true);
     test.RecordAnswer(true);
     Assert.AreSame(names[0], test.CurrentContestant().name);
 }
Пример #17
0
 public void TestRestartBee()
 {
     Bee test = new Bee();
     AddQuestions(test, 6);
     AddContestants(test, 3);
     test.RecordAnswer(true);
     test.RecordAnswer(false);
     test.RecordAnswer(false);
     test.RestartBee();
     Assert.IsTrue(test.QuestionList.Count() == 6 && test.ContestantList.Count() == 3);
 }