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