public void ClientFirstNameMaxPlusOne() { //create an instance of the class clsClient Aclient = new clsClient(); //create a variable to record Boolean Ok; //51 characters entry string SomeText = "LennisLennisLennisLennisLennisLennisLenLennisLennisLen"; //Test the valid method with a two character string Ok = Aclient.Valid(SomeText); //Assert that the outcome should be true Assert.IsFalse(Ok); }
public void ClientFirstNameMinLessOne() { //create an instance of the class clsClient AClient = new clsClient(); //create a variable to record the result of the validation test Boolean OK; //49 characters entry string SomeText = "LennisLennisLennisLennisLennisLennisLenLennisLennisL"; //test the valid method with a blank string OK = AClient.Valid(""); //assert that the outcome should be false Assert.IsFalse(OK); }
public void ClientPositionMaxPlusOne() { //create an instance of the class we want to create clsClient Aclient = new clsClient(); //boolean variable to store the results of the validation Boolean OK = false; //assign a position to variable string Position = " "; Position = Position.PadRight(51, 'a'); //try to send some data to the variable and property are the same Aclient.Position = Position; //invoke the method OK = Aclient.Valid(Position); //check to see that the data in the variable and property are the same Assert.AreEqual(Aclient.Position, Position); }
public void ClientFaxExtremeMax() { //create an instance of the class clsClient Aclient = new clsClient(); //boolean variable to store the results of the validation Boolean OK = false; //create some test data to pass to the method string FirstName = "Lennis"; string LastName = "Ngugi"; string Email = "*****@*****.**"; string Position = "Human Resource"; Int64 Telephone = 0748409423456; Int64 FaxNumber = 07484094234567678; //invoke the method OK = Aclient.Valid(FirstName, LastName, Email, Position, Telephone, FaxNumber); //test to see that the result is correct Assert.IsTrue(OK); }
public void ValidMethodOK() { //create an instance of the class we went to create clsClient AClient = new clsClient(); //boolean variable to store the results of the validation Boolean OK = false; //create some test data to pass to the method String CompanyNo = "1"; String FirstName = "Lennis"; String LastName = "Ngugi"; String Email = "*****@*****.**"; String Position = "Human Resource"; String Telephone = "02454435435"; String FaxNumber = "04554354354"; //invoke the method OK = AClient.Valid(CompanyNo, FirstName, LastName, Email, Position, Telephone, FaxNumber); //test to see what the result is correct Assert.IsTrue(OK); }
public void ClientFirstNameMid() { //create an instaqnce of the class we want to create clsClient Aclient = new clsClient(); //boolean variable to store the results of the validation Boolean OK = false; //create some test data to pass to the method string FirstName = " "; FirstName = FirstName.PadRight(15, 'a'); string LastName = "Ngugi"; string Email = "*****@*****.**"; string Position = "Human Resource"; Int64 Telephone = 07484094234; Int64 FaxNumber = 04545485956; //invoke the method OK = Aclient.Valid(FirstName, LastName, Email, Position, Telephone, FaxNumber); //test to see that the result is correct Assert.IsTrue(OK); }