Exemplo n.º 1
0
 // afiseaza in panelul existent urmatoarea intrebare
 private void UpdatePanel()
 {
     try
     {
         textBoxQuestion.Text = DataInstance.GetQuestionById(PanelsCounter + 1);
         A.Text = DataInstance.GetFirstAnswerByQuestionId(PanelsCounter + 1);
         B.Text = DataInstance.GetSecondAnswerByQuestionId(PanelsCounter + 1);
         C.Text = DataInstance.GetThirdAnswerByQuestionId(PanelsCounter + 1);
     }
     catch (System.IndexOutOfRangeException e)
     {
         System.Console.WriteLine(e.Message);
         throw new System.ArgumentOutOfRangeException("index parameter is out of range.", e);
     }
 }
        public void GetQuestionById_1()
        {
            QuestionsRetriever DataInstance = QuestionsRetriever.Instance();

            Assert.AreEqual("Într-o zonă pietonală, semnalizată ca atare, sunteţi obligat să circulaţi cu o viteză de:", DataInstance.GetQuestionById(1));
        }
        public void GetQuestionById_11()
        {
            QuestionsRetriever DataInstance = QuestionsRetriever.Instance();

            Assert.AreEqual(String.Empty, DataInstance.GetQuestionById(11));
        }