public void DirectorCommentInstanceOK() { //create an instance of the class DirectorComment NewDirectorComment = new DirectorComment(); //test to see if that exists Assert.IsNotNull(NewDirectorComment); }
public ActionResult Create(int directorReviewId, string username) { try { DirectorComment directorcomment = new DirectorComment(); directorcomment.DirectorReviewId = directorReviewId; directorcomment.UserName = username; return View(directorcomment); } 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 DirectorCommentDatePosted() { DirectorComment NewDirectorComment = new DirectorComment(); DateTime testDatePosted = DateTime.Today; NewDirectorComment.Posted = testDatePosted; Assert.AreEqual(testDatePosted, NewDirectorComment.Posted); }
public void DirectorCommentID() { //create an instance of the class DirectorComment NewDirectorComment = new DirectorComment(); Int32 TestDirectorCommentId = 1; NewDirectorComment.DirectorCommentId = TestDirectorCommentId; //test to see if that exists Assert.AreEqual(NewDirectorComment.DirectorCommentId, TestDirectorCommentId); }
public void DirectorCommentComment() { //create an instance of the class DirectorComment NewDirectorComment = new DirectorComment(); string TestDirectorCommentComment = "Test Message"; NewDirectorComment.Comment = TestDirectorCommentComment; //test to see if that exists Assert.AreEqual(NewDirectorComment.Comment, TestDirectorCommentComment); }
public void DirectorCommentExtremeLatest() { DirectorComment NewDirectorComment = new DirectorComment(); Boolean valid = false; int DirectorCommentId = 1; string username = new string('A', DirectorComment.textMidLength); DateTime datePosted = DateTime.Today.AddDays(+1000); string comment = new string('A', DirectorComment.textMidLength); valid = NewDirectorComment.Valid(DirectorCommentId, username, datePosted, comment); }
public void DirectorCommentExtremeEarliestDate() { DirectorComment NewDirectorComment = new DirectorComment(); Boolean valid = false; int DirectorCommentId = 1; string username = new string('A', DirectorComment.textMidLength); DateTime datePosted = DirectorComment.earliestDate; string comment = new string('A', DirectorComment.textMidLength); valid = NewDirectorComment.Valid(DirectorCommentId, username, datePosted, comment); }
public void DirectorCommentUserNameOk() { //create an instance of the class DirectorComment NewDirectorComment = new DirectorComment(); string TestDirectorCommentUserName = "******"; NewDirectorComment.UserName = TestDirectorCommentUserName; //test to see if that exists Assert.AreEqual(NewDirectorComment.UserName, TestDirectorCommentUserName); }
public void DirectorCommentUsernameMinimumPlusOne() { DirectorComment NewDirectorComment = new DirectorComment(); Boolean valid = false; int DirectorCommentId = 1; string username = new string('A', DirectorComment.textMinimumLength + 1); DateTime datePosted = DateTime.Today; string comment = new string('A', DirectorComment.textMidLength); valid = NewDirectorComment.Valid(DirectorCommentId, username, datePosted, comment); Assert.IsTrue(valid); }
public void DirectorCommentUsernameMinimumMinus1() { DirectorComment NewDirectorComment = new DirectorComment(); Boolean valid = false; int DirectorCommentId = 1; string username = new string('A', DirectorComment.textMinimumLength - 1); DateTime datePosted = DateTime.Today; string Comment = new string('A', DirectorComment.textMidLength); valid = NewDirectorComment.Valid(DirectorCommentId, username, datePosted, Comment); }
public void DirectorCommentUsernameExtremeMaximum() { DirectorComment NewDirectorComment = new DirectorComment(); Boolean valid = false; int DirectorCommentId = 1; string username = new string('A', DirectorComment.textExtremeMax); DateTime datePosted = DateTime.Today; string comment = new string('A', DirectorComment.textMidLength); valid = NewDirectorComment.Valid(DirectorCommentId, username, datePosted, comment); }