示例#1
0
        public void ValidationMethodOk()
        {
            //create an instance of the class we want to create
            clsTutor aTutor = new clsTutor();
            //string variable to store any error messages
            String Error = "";

            //invoke the method
            Error = aTutor.Valid(tutorFirstName, tutorLastName, tutorEmail, tutorSubject, tutorDateAdded, tutorPassword);
            //test to see that result is correct
            Assert.AreEqual(Error, "");
        }
示例#2
0
        public void TutorSubjectMinPlusOne()
        {
            //create an instance of the class we want to create
            clsTutor aTutor = new clsTutor();
            //string variable to store any error messages
            String Error = "";
            //creating some test data to pass the method
            string tutorEmail = "abcd"; //this should pass

            //invoke the method
            Error = aTutor.Valid(tutorFirstName, tutorLastName, tutorEmail, tutorSubject, tutorDateAdded, tutorPassword);
            //test to see that result is correct
            Assert.AreEqual(Error, "");
        }
示例#3
0
        public void TutorLastNameMaxLessOne()
        {
            //create an instance of the class we want to create
            clsTutor aTutor = new clsTutor();
            //string variable to store any error messages
            String Error = "";
            //creating some test data to pass the method
            string tutorLastName = ""; //this should pass

            tutorLastName = tutorLastName.PadRight(14, 'a');

            //invoke the method
            Error = aTutor.Valid(tutorFirstName, tutorLastName, tutorEmail, tutorSubject, tutorDateAdded, tutorPassword);
            Assert.AreEqual(Error, "");
        }
示例#4
0
        public void TutorPasswordExtremeMax()
        {
            //create an instance of the class we want to create
            clsTutor aTutor = new clsTutor();
            //string variable to store any error messages
            String Error = "";
            //creating some test data to pass the method
            string tutorPassword = "";

            tutorPassword = tutorPassword.PadRight(300, 'a'); //this should fail

            //invoke the method
            Error = aTutor.Valid(tutorFirstName, tutorLastName, tutorEmail, tutorSubject, tutorDateAdded, tutorPassword);
            //test to see that result is correct
            Assert.AreNotEqual(Error, "");
        }
示例#5
0
        public void DateAddedMin()
        {
            //create an instance of the class we want to create
            clsTutor aTutor = new clsTutor();
            //string variable to store any error messages
            String Error = "";
            //creating test variable to store test date
            DateTime TestDate;

            //set date to today
            TestDate = DateTime.Now.Date;// this should pass

            //have to convert date to string
            string DateAdded = TestDate.ToString();

            //invoke the method
            Error = aTutor.Valid(tutorFirstName, tutorLastName, tutorEmail, tutorSubject, tutorDateAdded, tutorPassword);
            //test to see that result is correct
            Assert.AreEqual(Error, "");
        }
示例#6
0
        public void DateAddedMinLessOne()
        {
            //create an instance of the class we want to create
            clsTutor aTutor = new clsTutor();
            //string variable to store any error messages
            String Error = "";
            //creating test variable to store test date
            DateTime TestDate;

            //set date to today
            TestDate = DateTime.Now.Date;

            //change the date to today -1 day
            TestDate = TestDate.AddDays(-1); // this should fail

            //have to convert date to string
            string tutorDateAdded = TestDate.ToString();

            //invoke the method
            Error = aTutor.Valid(tutorFirstName, tutorLastName, tutorEmail, tutorSubject, tutorDateAdded, tutorPassword);
            Assert.AreNotEqual(Error, "");
        }