Esempio n. 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, "");
        }
Esempio n. 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, "");
        }
Esempio n. 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, "");
        }
Esempio n. 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, "");
        }
Esempio n. 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, "");
        }
Esempio n. 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, "");
        }