Example #1
0
        public void ValidMethodOK()
        {
            clsReviews AnReviews = new clsReviews();
            String     Error     = "";

            Error = AnReviews.Valid(ReviewedProduct, ReviewText, DateAdded, ReviewerName);
            Assert.AreEqual(Error, "");
        }
Example #2
0
        public void ReviewedProductMaxPlusOne()
        {
            clsReviews AnReviews       = new clsReviews();
            String     Error           = "";
            string     ReviewedProduct = "";

            Error = AnReviews.Valid(ReviewedProduct, ReviewText,
                                    DateAdded, ReviewerName);
            Assert.AreNotEqual(Error, "");
        }
Example #3
0
        public void DateAddedInvalidData()
        {
            clsReviews AnReviews = new clsReviews();
            String     Error     = "";
            string     DateAdded = "This is not a date!";

            Error = AnReviews.Valid(ReviewedProduct, ReviewText,
                                    DateAdded, ReviewerName);
            Assert.AreNotEqual(Error, "");
        }
Example #4
0
        public void ReviewedProductMid()
        {
            clsReviews AnReviews       = new clsReviews();
            String     Error           = "";
            string     ReviewedProduct = "";

            ReviewedProduct = ReviewedProduct.PadRight(25, 'a');
            Error           = AnReviews.Valid(ReviewedProduct, ReviewText,
                                              DateAdded, ReviewerName);
            Assert.AreEqual(Error, "");
        }
Example #5
0
        public void DateAddedMin()
        {
            clsReviews AnReviews = new clsReviews();
            String     Error     = "";
            DateTime   TestDate;

            TestDate = DateTime.Now.Date;
            string DateAdded = TestDate.ToString();

            Error = AnReviews.Valid(ReviewedProduct, ReviewText,
                                    DateAdded, ReviewerName);
            Assert.AreEqual(Error, "");
        }
Example #6
0
        public void DateAddedExtremeMax()
        {
            clsReviews AnReviews = new clsReviews();
            String     Error     = "";
            DateTime   TestDate;

            TestDate = DateTime.Now.Date;
            TestDate = TestDate.AddYears(100);
            string DateAdded = TestDate.ToString();

            Error = AnReviews.Valid(ReviewedProduct, ReviewText,
                                    DateAdded, ReviewerName);
            Assert.AreNotEqual(Error, "");
        }
 public void ValidMethodOK()
 {
     //create an instance of the class we want to create 
     clsReviews AReviews = new clsReviews();
     //boolean variable to store the result of the validation
     Boolean Ok = false;
     //create some data to use with the method
     string Title = "haha";
     string MainReview = "great";
     string Score = "3.3";
     //invoke the method
     Ok = AReviews.Valid(Title, MainReview, Score);
     //test tto see that the reuslt is correct
     Assert.IsTrue(Ok);
 }
Example #8
0
        public void EmailExtremeMin()
        {
            //create a new instance of the class we want to create
            clsReviews TestItem = new clsReviews();;
            //string variable to store result of validation
            string AllOK = "";
            //create some test data to assign to property
            string Email      = "";
            string Exp        = " loved it thanks ";
            string Improveexp = " no mate loved it thanks ! ";

            //invoke method
            AllOK = TestItem.Valid(Email, Exp, Improveexp);
            //test to see if it exists
            Assert.AreNotEqual(AllOK, "");
        }
Example #9
0
        public void ImproveexpExtremeMax()
        {
            //create a new instance of the class we want to create
            clsReviews TestItem = new clsReviews();;
            //string variable to store result of validation
            string AllOK = "";
            //create some test data to assign to property
            string Email      = " [email protected]";
            string Exp        = " loved it thanks ";
            string Improveexp = " Samsung6532562147858325444125111111111111111111111111111111  ";

            //invoke method
            AllOK = TestItem.Valid(Email, Exp, Improveexp);
            //test to see if it exists
            Assert.AreNotEqual(AllOK, "");
        }
Example #10
0
        public void ImproveexpMaxPlus1()
        {
            //create a new instance of the class we want to create
            clsReviews TestItem = new clsReviews();;
            //string variable to store result of validation
            string AllOK = "";
            //create some test data to assign to property
            string Email      = " [email protected]";
            string Exp        = " loved it thanks ";
            string Improveexp = " Abcdefhjklmnjhsaqweaa  ";

            //invoke method
            AllOK = TestItem.Valid(Email, Exp, Improveexp);
            //test to see if it exists
            Assert.AreEqual(AllOK, "");
        }