public void MovieReviewInstanceOK()
 {
     //create an instance of the class
     MovieReview NewMovieReview = new MovieReview();
     //test to see if that exists
     Assert.IsNotNull(NewMovieReview);
 }
 public void MovieReviewDatePosted()
 {
     MovieReview NewMovieReview = new MovieReview();
     DateTime testDatePosted = DateTime.Today;
     NewMovieReview.Posted = testDatePosted;
     Assert.AreEqual(testDatePosted, NewMovieReview.Posted);
 }
        public ActionResult Create(int movieId, string username)
        {
            try
            {
                MovieReview moviereview = new MovieReview();
                moviereview.MovieId = movieId;
                moviereview.UserName = username;

                return View(moviereview);
            }
            catch (DataException ex)
            {
                var contentMessage = String.Format("{0}{1}", "Wrong Data has entered: ", ex.Message);
                logger.Info(contentMessage);
                return RedirectToAction("Error", "Home");
            }
            catch (InvalidOperationException ex)
            {
                var contentMessage = String.Format("{0}{1}", "Please close the database connection ", ex.Message);
                logger.Info(contentMessage);
                return RedirectToAction("Error", "Home");
            }
            catch (Exception ex)
            {
                var contentMessage = String.Format("{0}{1}", "Something went wrong. ", ex.Message);
                logger.Info(contentMessage);
                return RedirectToAction("Error", "Home");
            }
        }
        public void MovieReviewReview()
        {
            //create an instance of the class
            MovieReview NewMovieReview = new MovieReview();

            string TestMovieReviewReview = "Test Message";
            NewMovieReview.Review = TestMovieReviewReview;
            //test to see if that exists
            Assert.AreEqual(NewMovieReview.Review, TestMovieReviewReview);
        }
        public void MovieReviewID()
        {
            //create an instance of the class
            MovieReview NewMovieReview = new MovieReview();

            Int32 TestMovieReviewId = 1;
            NewMovieReview.MovieReviewId = TestMovieReviewId;
            //test to see if that exists
            Assert.AreEqual(NewMovieReview.MovieReviewId, TestMovieReviewId);
        }
        public void MovieReviewExtremeLatest()
        {
            MovieReview NewMovieReview = new MovieReview();
            Boolean valid = false;
            int MovieReviewId = 1;
            string username = new string('A', MovieReview.textMidLength);
            DateTime datePosted = DateTime.Today.AddDays(+1000);
            string review = new string('A', MovieReview.textMidLength);

            valid = NewMovieReview.Valid(MovieReviewId, username, datePosted, review);
        }
        public void MovieReviewExtremeEarliestDate()
        {
            MovieReview NewMovieReview = new MovieReview();
            Boolean valid = false;
            int MovieReviewId = 1;
            string username = new string('A', MovieReview.textMidLength);
            DateTime datePosted = MovieReview.earliestDate;
            string review = new string('A', MovieReview.textMidLength);

            valid = NewMovieReview.Valid(MovieReviewId, username, datePosted, review);
        }
        public void MovieReviewReviewExtremeMaximum()
        {
            MovieReview NewMovieReview = new MovieReview();
            Boolean valid = false;
            int MovieReviewId = 1;
            string username = new string('A', MovieReview.textMidLength);
            DateTime datePosted = DateTime.Today;
            string review = new string('A', MovieReview.textExtremeMax);

            valid = NewMovieReview.Valid(MovieReviewId, username, datePosted, review);
        }
        public void MovieReviewUserNameOk()
        {
            //create an instance of the class
            MovieReview NewMovieReview = new MovieReview();

            string TestMovieReviewUserName = "******";
            NewMovieReview.UserName = TestMovieReviewUserName;
            //test to see if that exists
            Assert.AreEqual(NewMovieReview.UserName, TestMovieReviewUserName);
        }
        public void MovieReviewUsernameMinimumPlusOne()
        {
            MovieReview NewMovieReview = new MovieReview();
            Boolean valid = false;
            int MovieReviewId = 1;
            string username = new string('A', MovieReview.textMinimumLength + 1);
            DateTime datePosted = DateTime.Today;
            string review = new string('A', MovieReview.textMidLength);

            valid = NewMovieReview.Valid(MovieReviewId, username, datePosted, review);
            Assert.IsTrue(valid);
        }