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")); }
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); }
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); }