public IActionResult GetFullFilmDetailsByIdFilm(int idFilm)
        {
            ResponseSingleObject <FullFilmDTO> responseSingleObject = new ResponseSingleObject <FullFilmDTO>()
            {
                Status   = StatusCodes.Status500InternalServerError,
                Errors   = null,
                Message  = null,
                Succeded = false,
                Value    = null
            };

            try
            {
                FullFilmDTO fullFilmDto = _bllManager.GetFullFilmDetailsByIdFilm(idFilm);
                if (fullFilmDto == null)
                {
                    responseSingleObject.Status = StatusCodes.Status404NotFound;
                    responseSingleObject.Errors = "aucun film trouve pour l id(" + idFilm + ")";
                }
                else
                {
                    responseSingleObject.Status = StatusCodes.Status200OK;
                    responseSingleObject.Value  = fullFilmDto;
                }
            }
            catch (Exception e)
            {
                responseSingleObject.Errors =
                    "GetFullFilmDetailsByIdFilm pour le film dont l id =(" + idFilm + ") EXCEPTION : " + e.ToString();
            }

            return(StatusCode(responseSingleObject.Status, responseSingleObject));
        }
        public void testInsertComment()
        {
            Console.WriteLine("insert comment...");
            _bllManager.InsertComment(_comment);
            Console.WriteLine("insert comment ok : affichage à partir de la lecture de la bd :");

            FullFilmDTO film      = _bllManager.GetFullFilmDetailsByIdFilm(_comment.Film.Id);
            int         idComment = 0;

            foreach (CommentDTO filmComment in film.Comments)
            {
                idComment = filmComment.Id;
            }

            Console.WriteLine("Film : \n" + film.ToStringAll());

            _comment = _bllManager.getCommentFromId(idComment);
            Console.WriteLine("Comment : \n" + _comment.ToStringWithFilm());

            Assert.Pass();
        }
Example #3
0
        [TestCase(10)] //rien !
        public void testGetFullFilmDetailsByIdFilm(int idFilm)
        {
            BllManager  bllManager = new BllManager();
            FullFilmDTO film       = bllManager.GetFullFilmDetailsByIdFilm(idFilm);

            if (film != null)
            {
                Console.WriteLine("Film pour l'id(" + idFilm + ") : \n" + film.ToStringAll());
            }
            else
            {
                Console.WriteLine("Pas de Film trouvé pour l'id : " + idFilm);
            }

            Assert.Pass();
        }