public void TestCreateNewFilm_DescriptionToShort() { Film film = new Film { FilmID = 10, FilmName = "TestFilm", FilmDescription = "", FilmImage = "", Genre = Genre.Fantasy, FilmReviews = null }; FilmsController filmController = new FilmsController(); // Act ViewResult result = filmController.Create(film) as ViewResult; // Assert Assert.AreEqual("Invalid Length", result.ViewBag.Message); }
public void TestCreateNewFilm_NullValue() { Film film = new Film { FilmID = 10, FilmName = null, FilmDescription = "Test Description", FilmImage = "", Genre = Genre.Fantasy, FilmReviews = null }; FilmsController filmController = new FilmsController(); // Act ViewResult result = filmController.Create(film) as ViewResult; // Assert Assert.AreEqual("Null Value", result.ViewBag.Message); }
public void TestEditFilm_Invalid_User_Data() { Film film = new Film { FilmID = 10, FilmName = "", FilmDescription = "test", FilmImage = "", Genre = Genre.Fantasy, FilmReviews = null }; FilmsController filmController = new FilmsController(); // Act ViewResult result = filmController.Edit(film) as ViewResult; // Assert Assert.AreEqual("Invalid user entry", result.ViewBag.Message); }