Beispiel #1
0
        public void DeveDevolverBadRequestAoBuscarQuestoesComUmIdInvalidoDeUmaTarefa()
        {
            var controller = new QuestoesController(null, null, null);

            var retorno = controller.PorTarefa(0);

            Assert.IsInstanceOf <BadRequestErrorMessageResult>(retorno);
            Assert.That(((BadRequestErrorMessageResult)retorno).Message, Is.EqualTo("Informe um id da tarefa"));
        }
Beispiel #2
0
        public void DeveDevolverNotFoundAoNaoEncontrarQuestoesDaTarefa()
        {
            var tarefas = Substitute.For <Tarefas>((ISession)null);

            tarefas.QuestoesPorTarefa(1).Returns(new List <Questao>());

            var controller = new QuestoesController(null, tarefas, null);

            var retorno = controller.PorTarefa(1);

            Assert.IsInstanceOf <NotFoundResult>(retorno);
        }
Beispiel #3
0
        public void DeveDevolverNotFoundAoNaoEncontrarQuestoesDoProfessor()
        {
            var questoes = Substitute.For <Questoes>((ISession)null);

            questoes.PorProfessor(1).Returns(new List <Questao>());

            var controller = new QuestoesController(questoes, null, null);

            var retorno = controller.PorProfessor(1);

            Assert.IsInstanceOf <NotFoundResult>(retorno);
        }