Example #1
0
        public void MoviesWorldCupControler_Consultar_FiltroVazio_RetornarBadRequest()
        {
            MoviesController controller = GerarControllerTesteComMovies();

            var response = controller.Consultar(new MoviesConsultaRequest());

            HttpTools.AssertExecuteAsyncResponse(response, HttpStatusCode.BadRequest);
        }
Example #2
0
        public void MoviesWorldCupController_Consultar_NenhumRegistroEncontrado_RetornarStatusCodeNotFound()
        {
            MoviesController controller = GerarControllerTesteComMovies();

            var filtro   = MontarFiltroPadrao();
            var response = controller.Consultar(filtro);

            HttpTools.AssertExecuteAsyncResponse(response, HttpStatusCode.NotFound);
        }
Example #3
0
        public void MoviesWorldCupControler_Consultar_ParametroInvalido_Titulo_RetornarBadRequest()
        {
            MoviesController controller = GerarControllerTesteComMovies();

            var response = controller.Consultar(new MoviesConsultaRequest {
                Titulo = TestConstants.TituloInvalido.ToString()
            });

            HttpTools.AssertExecuteAsyncResponse(response, HttpStatusCode.BadRequest);
        }
Example #4
0
        public void MoviesWorldCupControler_Consultar_ParametroInvalido_Id_RetornarBadRequest()
        {
            MoviesController controller = GerarControllerTesteComMovies();

            var response = controller.Consultar(new MoviesConsultaRequest {
                Id = Convert.ToInt16(TestConstants.IdInvalido)
            });

            HttpTools.AssertExecuteAsyncResponse(response, HttpStatusCode.BadRequest);
        }
Example #5
0
        public void MoviesWorldCupControler_Consultar_RegistroEncontrado_RetornarOk()
        {
            var movie = EntityTools.GerarMovie("tinc010102");
            MoviesController controller = GerarControllerTesteComMovies(movie);

            var filtro   = MontarFiltroPadrao();
            var response = controller.Consultar(filtro);

            HttpTools.AssertExecuteAsyncResponse(response, HttpStatusCode.OK);
        }