Пример #1
0
        public void CorrectQuestionTest(int newQuestionNum, string newQuestion)
        {
            //act
            var message = _qcl.ChangeQuestion();

            //assert
            Assert.AreEqual(newQuestionNum, newQuestion, message);
        }
Пример #2
0
 //UpdateQuestion method logic
 private void UpdateQuestion()
 {
     AButton.IsEnabled = true;
     BButton.IsEnabled = true;
     CButton.IsEnabled = true;
     DButton.IsEnabled = true;
     //Update question number
     QuestionNumber.Text = $"Question: {(qcl.currentQ += 1).ToString()}/29";
     //Change to next question
     QDisplay.Text = qcl.ChangeQuestion();
     //Change the answers on each button and return them to grey
     AButton.Content = $"{ qcl.ChangeNonAnswer1()}";
     BButton.Content = $"{ qcl.ChangeNonAnswer2()}";
     CButton.Content = $"{ qcl.ChangeNonAnswer3()}";
     DButton.Content = $"{ qcl.ChangeAnswer()}";
     //Switch the positions of the buttons
     if (qcl.ButtonMover() == 1)
     {
         AButton.Margin = new Thickness(10, 213, 0, 0);
         BButton.Margin = new Thickness(205, 213, 0, 0);
         CButton.Margin = new Thickness(10, 349, 0, 0);
         DButton.Margin = new Thickness(205, 349, 0, 0);
     }
     else if (qcl.ButtonMover() == 2)
     {
         DButton.Margin = new Thickness(10, 213, 0, 0);
         AButton.Margin = new Thickness(205, 213, 0, 0);
         BButton.Margin = new Thickness(10, 349, 0, 0);
         CButton.Margin = new Thickness(205, 349, 0, 0);
     }
     else if (qcl.ButtonMover() == 3)
     {
         CButton.Margin = new Thickness(10, 213, 0, 0);
         DButton.Margin = new Thickness(205, 213, 0, 0);
         AButton.Margin = new Thickness(10, 349, 0, 0);
         BButton.Margin = new Thickness(205, 349, 0, 0);
     }
     else
     {
         BButton.Margin = new Thickness(10, 213, 0, 0);
         CButton.Margin = new Thickness(205, 213, 0, 0);
         DButton.Margin = new Thickness(10, 349, 0, 0);
         AButton.Margin = new Thickness(205, 349, 0, 0);
     }
 }