public void LastNameMid() { //create an instance of the class we want to create clsStaff AStaff = new clsStaff(); //boolean variable to store the result of the validation Boolean LastNameOK = false; //create some test data to assign the property string SomeLastName = "anhthyhjuk"; //invoke the method LastNameOK = AStaff.LastNameValid(SomeLastName); //test to see if the result is correct Assert.IsTrue(LastNameOK); }
public void PhoneNoExtremeMax() { //create an instance of the class we want to create clsStaff AStaff = new clsStaff(); //boolean variable to store the result of the validation Boolean PhoneNoOK = false; //create some test data to assign to the property string SomePhoneNo = ""; //pad the string with characters SomePhoneNo = SomePhoneNo.PadRight(300, '1'); //invoke the method PhoneNoOK = AStaff.LastNameValid(SomePhoneNo); //test to see if that result is correct Assert.IsFalse(PhoneNoOK); }