public void DirectorReviewInstanceOK()
 {
     //create an instance of the class
     DirectorReview NewDirectorReview = new DirectorReview();
     //test to see if that exists
     Assert.IsNotNull(NewDirectorReview);
 }
 public void DirectorReviewDatePosted()
 {
     DirectorReview NewDirectorReview = new DirectorReview();
     DateTime testDatePosted = DateTime.Today;
     NewDirectorReview.Posted = testDatePosted;
     Assert.AreEqual(testDatePosted, NewDirectorReview.Posted);
 }
 public ActionResult Create(int directorId, string username)
 {
     try
     {
         DirectorReview directorreview = new DirectorReview();
         directorreview.DirectorId = directorId;
         directorreview.UserName = username;
         return View(directorreview);
     }
     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 DirectorReviewReview()
        {
            //create an instance of the class
            DirectorReview NewDirectorReview = new DirectorReview();

            string TestDirectorReviewReview = "Test Message";
            NewDirectorReview.Review = TestDirectorReviewReview;
            //test to see if that exists
            Assert.AreEqual(NewDirectorReview.Review, TestDirectorReviewReview);
        }
        public void DirectorReviewID()
        {
            //create an instance of the class
            DirectorReview NewDirectorReview = new DirectorReview();

            Int32 TestDirectorReviewId = 1;
            NewDirectorReview.DirectorReviewId = TestDirectorReviewId;
            //test to see if that exists
            Assert.AreEqual(NewDirectorReview.DirectorReviewId, TestDirectorReviewId);
        }
        public void DirectorReviewExtremeLatest()
        {
            DirectorReview NewDirectorReview = new DirectorReview();
            Boolean valid = false;
            int DirectorReviewId = 1;
            string username = new string('A', DirectorReview.textMidLength);
            DateTime datePosted = DateTime.Today.AddDays(+1000);
            string review = new string('A', DirectorReview.textMidLength);

            valid = NewDirectorReview.Valid(DirectorReviewId, username, datePosted, review);
        }
        public void DirectorReviewExtremeEarliestDate()
        {
            DirectorReview NewDirectorReview = new DirectorReview();
            Boolean valid = false;
            int DirectorReviewId = 1;
            string username = new string('A', DirectorReview.textMidLength);
            DateTime datePosted = DirectorReview.earliestDate;
            string review = new string('A', DirectorReview.textMidLength);

            valid = NewDirectorReview.Valid(DirectorReviewId, username, datePosted, review);
        }
        public void DirectorReviewReviewExtremeMinimumLength()
        {
            DirectorReview NewDirectorReview = new DirectorReview();
            Boolean valid = false;
            int DirectorReviewId = 1;
            string username = new string('A', DirectorReview.textMidLength);
            DateTime datePosted = DateTime.Today;
            string review = new string('A', DirectorReview.textExtremeMin);

            valid = NewDirectorReview.Valid(DirectorReviewId, username, datePosted, review);
        }
        public void DirectorReviewUserNameOk()
        {
            //create an instance of the class
            DirectorReview NewDirectorReview = new DirectorReview();

            string TestDirectorReviewUserName = "******";
            NewDirectorReview.UserName = TestDirectorReviewUserName;
            //test to see if that exists
            Assert.AreEqual(NewDirectorReview.UserName, TestDirectorReviewUserName);
        }
Ejemplo n.º 10
0
        public void DirectorReviewUsernameMinimumPlusOne()
        {
            DirectorReview NewDirectorReview = new DirectorReview();
            Boolean valid = false;
            int DirectorReviewId = 1;
            string username = new string('A', DirectorReview.textMinimumLength + 1);
            DateTime datePosted = DateTime.Today;
            string review = new string('A', DirectorReview.textMidLength);

            valid = NewDirectorReview.Valid(DirectorReviewId, username, datePosted, review);
            Assert.IsTrue(valid);
        }