Exemplo n.º 1
0
        public ActionResult ChangeStatus(int id, string status, string path)
        {
            string[] redirectUrl = path.Split("/");

            _questionLogic.ChangeStatus(id, status);
            if (redirectUrl[2] == "Overview")
            {
                return(RedirectToAction(nameof(Overview)));
            }

            return(RedirectToAction(nameof(OverviewClosed)));
        }
Exemplo n.º 2
0
        public void ChangeQuestionStatus_IsValid()
        {
            Mock <IQuestionContext> mockContext = new Mock <IQuestionContext>();

            Category category = new Category("Medisch");
            Question question = new Question(1, "foo", "baa", Question.QuestionStatus.Closed, DateTime.Today, true, category, 12);

            QuestionLogic logic = new QuestionLogic(mockContext.Object);

            logic.ChangeStatus(question.QuestionId, Question.QuestionStatus.Closed.ToString());

            Assert.AreNotEqual(question.Status.ToString(), "Open");
        }