예제 #1
0
 public void ActorCommentDatePosted()
 {
     ActorComment NewActorComment = new ActorComment();
     DateTime testDatePosted = DateTime.Today;
     NewActorComment.Posted = testDatePosted;
     Assert.AreEqual(testDatePosted, NewActorComment.Posted);
 }
예제 #2
0
 public void ActorCommentInstanceOK()
 {
     //create an instance of the class
     ActorComment NewActorComment = new ActorComment();
     //test to see if that exists
     Assert.IsNotNull(NewActorComment);
 }
 public ActionResult Create(int actorReviewId, string username )
 {
     try
     {
         ActorComment actorcomment = new ActorComment();
         actorcomment.ActorReviewId = actorReviewId;
         actorcomment.UserName = username;
         return View(actorcomment);
     }
     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");
     }
 }
예제 #4
0
        public void ActorCommentID()
        {
            //create an instance of the class
            ActorComment NewActorComment = new ActorComment();

            Int32 TestActorCommentId = 1;
            NewActorComment.ActorCommentId = TestActorCommentId;
            //test to see if that exists
            Assert.AreEqual(NewActorComment.ActorCommentId, TestActorCommentId);
        }
예제 #5
0
        public void ActorCommentComment()
        {
            //create an instance of the class
            ActorComment NewActorComment = new ActorComment();

            string TestActorCommentComment = "Test Message";
            NewActorComment.Comment = TestActorCommentComment;
            //test to see if that exists
            Assert.AreEqual(NewActorComment.Comment, TestActorCommentComment);
        }
예제 #6
0
        public void ActorCommentExtremeLatest()
        {
            ActorComment NewActorComment = new ActorComment();
            Boolean valid = false;
            int ActorCommentId = 1;
            string username = new string('A', ActorComment.textMidLength);
            DateTime datePosted = DateTime.Today.AddDays(+1000);
            string comment = new string('A', ActorComment.textMidLength);

            valid = NewActorComment.Valid(ActorCommentId, username, datePosted, comment);
        }
예제 #7
0
        public void ActorCommentExtremeEarliestDate()
        {
            ActorComment NewActorComment = new ActorComment();
            Boolean valid = false;
            int ActorCommentId = 1;
            string username = new string('A', ActorComment.textMidLength);
            DateTime datePosted = ActorComment.earliestDate;
            string comment = new string('A', ActorComment.textMidLength);

            valid = NewActorComment.Valid(ActorCommentId, username, datePosted, comment);
        }
예제 #8
0
        public void ActorCommentommentExtremeMinimumLength()
        {
            ActorComment NewActorComment = new ActorComment();
            Boolean valid = false;
            int ActorCommentId = 1;
            string username = new string('A', ActorComment.textMidLength);
            DateTime datePosted = DateTime.Today;
            string comment = new string('A', ActorComment.textExtremeMin);

            valid = NewActorComment.Valid(ActorCommentId, username, datePosted, comment);
        }
예제 #9
0
        public void ActorCommentUserNameOk()
        {
            //create an instance of the class
            ActorComment NewActorComment = new ActorComment();

            string TestActorCommentUserName = "******";
            NewActorComment.UserName = TestActorCommentUserName;
            //test to see if that exists
            Assert.AreEqual(NewActorComment.UserName, TestActorCommentUserName);
        }
예제 #10
0
        public void ActorCommentUsernameMinimumPlusOne()
        {
            ActorComment NewActorComment = new ActorComment();
            Boolean valid = false;
            int ActorCommentId = 1;
            string username = new string('A', ActorComment.textMinimumLength + 1);
            DateTime datePosted = DateTime.Today;
            string comment = new string('A', ActorComment.textMidLength);

            valid = NewActorComment.Valid(ActorCommentId, username, datePosted, comment);
            Assert.IsTrue(valid);
        }