Beispiel #1
0
        public void QuestionManagement_getQuestionById0Test_Return_NullReferenceException()
        {
            QuestionManagement qManager = new QuestionManagement();
            Question           q        = qManager.getQuestionById(0);

            Assert.IsNotNull(q.question);
        }
Beispiel #2
0
        public void QuestionManagement_getQuestionByIdTest_ReturnValue()
        {
            QuestionManagement qManager = new QuestionManagement();
            Question           q        = qManager.getQuestionById(1);

            Assert.AreEqual(q.answers[0].GetAnswer(), "122");
            Assert.AreEqual(q.answers[1].GetAnswer(), "133");
            Assert.AreEqual(q.answers[2].GetAnswer(), "144");
            Assert.AreEqual(q.answers[3].GetAnswer(), "112");
        }
Beispiel #3
0
        public void QuestionFactory_MapQuestion_ReturnValueObject()
        {
            EHFragenEntities   ehfEntitie = new EHFragenEntities();
            QuestionFactory    qFactory   = new QuestionFactory();
            QuestionManagement qManager   = new QuestionManagement();
            Question           managerQ   = qManager.getQuestionById(1);

            Fragenbogen_RK.Fragen fragen    = ehfEntitie.Fragens.Where(x => (x.P_Id == 1)).FirstOrDefault();
            List <Antworten>      antworten = ehfEntitie.Antwortens.Where(x => (x.P_Id == 1)).ToList();

            Question factoryQ = qFactory.MapQuestion(fragen, antworten);

            Assert.AreEqual(factoryQ.question, managerQ.question);
        }