Пример #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"));
        }
Пример #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);
        }