public void ActorCommentDatePosted() { ActorComment NewActorComment = new ActorComment(); DateTime testDatePosted = DateTime.Today; NewActorComment.Posted = testDatePosted; Assert.AreEqual(testDatePosted, NewActorComment.Posted); }
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"); } }
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); }
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); }
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); }
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); }
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); }
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); }
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); }