Example #1
0
        public void QuestionFactory_MapAnswers_ReturnValue()
        {
            EHFragenEntities ehfEntitie = new EHFragenEntities();
            QuestionFactory  qFactory   = new QuestionFactory();

            List <Antworten> antworten  = ehfEntitie.Antwortens.Where(x => (x.P_Id == 1)).ToList();
            List <Answer>    answerList = qFactory.MapAnswers(antworten);

            Assert.AreEqual(answerList[0].GetAnswer(), "122");
        }
Example #2
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);
        }