public void SetQuizVariablesTest()
 {
     model.CurrentQuiz = quizViewModel.GetQuizByTitle("Test Quiz");
     model.SetQuizVariables(model.CurrentQuiz);
     Assert.AreEqual(model.Id, model.CurrentQuiz.Id);
     Assert.AreEqual(model.Title, model.CurrentQuiz.Title);
     Assert.AreEqual(model.Description, model.CurrentQuiz.Description);
     Assert.AreEqual(model.PassMark, model.CurrentQuiz.PassMark);
     Assert.AreEqual(model.Category, model.CurrentQuiz.Category);
     //Do not check Questions as I am setting the Answer.IsCorrect value to be different based on the Correct Property
     //Assert.AreEqual(model.Questions, model.CurrentQuiz.Questions);
 }
예제 #2
0
 // GET: Edit Quiz
 public ActionResult EditQuiz(EditQuizViewModel model, string QuizName)
 {
     if (model.Id == 0)
     {
         model.CurrentQuiz = quizViewModel.GetQuizByTitle(QuizName);
         model.SetQuizVariables(model.CurrentQuiz);
     }
     else
     {
         model.SaveQuizDetails();
     }
     model.Categories = quizViewModel.Categories;
     return(View(model));
 }
예제 #3
0
        public void GetQuizByTitleTest()
        {
            Quiz searchedForByTitle = model.GetQuizByTitle("Test Quiz");

            Assert.AreEqual(searchedForByTitle.Title, "Test Quiz");
        }