コード例 #1
0
        public void TestCreateNewFilmReview_ValidInput()
        {
            FilmReview filmReview = new FilmReview
            {
                FilmID = 1,
                UserID = 1,
                ReviewContent = "TestDescription",
                Rating = Rating.Brilliant
            };

            FilmReviewsController filmReviewsController = new FilmReviewsController();

            // Act
            ViewResult result = filmReviewsController.Create(filmReview) as ViewResult;

            // Assert
            Assert.AreEqual("Valid", result.ViewBag.Message);
        }
コード例 #2
0
        public void TestCreateNewFilmReview_NullValue()
        {
            FilmReview filmReview = new FilmReview
            {
                FilmID = 1,
                UserID = 1,
                ReviewContent = null,
                Rating = Rating.Brilliant
            };

            FilmReviewsController filmReviewsController = new FilmReviewsController();

            // Act
            ViewResult result = filmReviewsController.Create(filmReview) as ViewResult;

            // Assert
            Assert.AreEqual("Null Value", result.ViewBag.Message);
        }