public void MovieCommentDatePosted()
 {
     MovieComment NewMovieComment = new MovieComment();
     DateTime testDatePosted = DateTime.Today;
     NewMovieComment.Posted = testDatePosted;
     Assert.AreEqual(testDatePosted, NewMovieComment.Posted);
 }
 public void MovieCommentInstanceOK()
 {
     //create an instance of the class
     MovieComment NewMovieComment = new MovieComment();
     //test to see if that exists
     Assert.IsNotNull(NewMovieComment);
 }
 public ActionResult Create(int movieReviewId, string username)
 {
     try
     {
         MovieComment moviecomment = new MovieComment();
         moviecomment.MovieReviewId = movieReviewId;
         moviecomment.UserName = username;
         return View(moviecomment);
     }
     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 MovieCommentID()
        {
            //create an instance of the class
            MovieComment NewMovieComment = new MovieComment();

            Int32 TestMovieCommentId = 1;
            NewMovieComment.MovieCommentId = TestMovieCommentId;
            //test to see if that exists
            Assert.AreEqual(NewMovieComment.MovieCommentId, TestMovieCommentId);
        }
        public void MovieCommentComment()
        {
            //create an instance of the class
            MovieComment NewMovieComment = new MovieComment();

            string TestMovieCommentComment = "Test Message";
            NewMovieComment.Comment = TestMovieCommentComment;
            //test to see if that exists
            Assert.AreEqual(NewMovieComment.Comment, TestMovieCommentComment);
        }
        public void MovieCommentExtremeLatest()
        {
            MovieComment NewMovieComment = new MovieComment();
            Boolean valid = false;
            int MovieCommentId = 1;
            string username = new string('A', MovieComment.textMidLength);
            DateTime datePosted = DateTime.Today.AddDays(+1000);
            string comment = new string('A', MovieComment.textMidLength);

            valid = NewMovieComment.Valid(MovieCommentId, username, datePosted, comment);
        }
        public void MovieCommentExtremeEarliestDate()
        {
            MovieComment NewMovieComment = new MovieComment();
            Boolean valid = false;
            int MovieCommentId = 1;
            string username = new string('A', MovieComment.textMidLength);
            DateTime datePosted = MovieComment.earliestDate;
            string comment = new string('A', MovieComment.textMidLength);

            valid = NewMovieComment.Valid(MovieCommentId, username, datePosted, comment);
        }
        public void MovieCommentommentExtremeMinimumLength()
        {
            MovieComment NewMovieComment = new MovieComment();
            Boolean valid = false;
            int MovieCommentId = 1;
            string username = new string('A', MovieComment.textMidLength);
            DateTime datePosted = DateTime.Today;
            string comment = new string('A', MovieComment.textExtremeMin);

            valid = NewMovieComment.Valid(MovieCommentId, username, datePosted, comment);
        }
        public void MovieCommentUserNameOk()
        {
            //create an instance of the class
            MovieComment NewMovieComment = new MovieComment();

            string TestMovieCommentUserName = "******";
            NewMovieComment.UserName = TestMovieCommentUserName;
            //test to see if that exists
            Assert.AreEqual(NewMovieComment.UserName, TestMovieCommentUserName);
        }
        public void MovieCommentUsernameMinimumPlusOne()
        {
            MovieComment NewMovieComment = new MovieComment();
            Boolean valid = false;
            int MovieCommentId = 1;
            string username = new string('A', MovieComment.textMinimumLength + 1);
            DateTime datePosted = DateTime.Today;
            string comment = new string('A', MovieComment.textMidLength);

            valid = NewMovieComment.Valid(MovieCommentId, username, datePosted, comment);
            Assert.IsTrue(valid);
        }