Ejemplo n.º 1
0
        public void AddAswerToQuestionTest()
        {
            QuestionManagement _QuestionManagement = new QuestionManagement();
            IAnswerManagement  _AnswerManagement   = AnswerManagement.Instance();

            DAO.Question _Question = _QuestionManagement.GetQuestion(StaticQuestions.Q1);
            _QuestionManagement.AddAnswer(_Question, _AnswerManagement.GetAnswer(StaticAnswers.A1));
            _QuestionManagement.AddAnswer(_Question, _AnswerManagement.GetAnswer(StaticAnswers.A2));
            _QuestionManagement.AddAnswer(_Question, _AnswerManagement.GetAnswer(StaticAnswers.A3));

            _Question = _QuestionManagement.GetQuestion(StaticQuestions.Q2);
            _QuestionManagement.AddAnswer(_Question, _AnswerManagement.GetAnswer(StaticAnswers.A4));
            _QuestionManagement.AddAnswer(_Question, _AnswerManagement.GetAnswer(StaticAnswers.A5));
            _QuestionManagement.AddAnswer(_Question, _AnswerManagement.GetAnswer(StaticAnswers.A6));

            _Question = _QuestionManagement.GetQuestion(StaticQuestions.Q3);
            _QuestionManagement.AddAnswer(_Question, _AnswerManagement.GetAnswer(StaticAnswers.A7));
            _QuestionManagement.AddAnswer(_Question, _AnswerManagement.GetAnswer(StaticAnswers.A8));
            _QuestionManagement.AddAnswer(_Question, _AnswerManagement.GetAnswer(StaticAnswers.A9));

            _Question = _QuestionManagement.GetQuestion(StaticQuestions.Q4);
            _QuestionManagement.AddAnswer(_Question, _AnswerManagement.GetAnswer(StaticAnswers.A10));
            _QuestionManagement.AddAnswer(_Question, _AnswerManagement.GetAnswer(StaticAnswers.A11));
            _QuestionManagement.AddAnswer(_Question, _AnswerManagement.GetAnswer(StaticAnswers.A12));

            _Question = _QuestionManagement.GetQuestion(StaticQuestions.Q5);
            _QuestionManagement.AddAnswer(_Question, _AnswerManagement.GetAnswer(StaticAnswers.A13));
            _QuestionManagement.AddAnswer(_Question, _AnswerManagement.GetAnswer(StaticAnswers.A14));
            _QuestionManagement.AddAnswer(_Question, _AnswerManagement.GetAnswer(StaticAnswers.A15));

            _DbContext.SaveChanges();

            Assert.True(_Question.Answers.Count() == 3);
            Assert.True(_Question.Answers.Where(x => x.AnswerId == _AnswerManagement.GetAnswer(StaticAnswers.A14).Id).Count() == 1);
        }
 public override void Load()
 {
     Bind <IAnswerManagement>().ToMethod(x => AnswerManagement.Instance());
     Bind <IInterviweeManagement>().ToMethod(x => InterviweeManagement.Instance());
     Bind <IQuestionManagement>().ToMethod(x => QuestionManagement.Instance());
     Bind <IStatistic>().ToMethod(x => Statistic.Instance());
     Bind <ITesting>().ToMethod(x => Testing.Instance());
     Bind <ITestManagement>().ToMethod(x => TestManagement.Instance());
 }