public void ClientAddressMaxLessOne() { //create an instance of the class we want to create clsClient AClient = new clsClient(); //boolean variable to store the result of the validation Boolean OK = false; //create some test data to pass to the method string ClientName = "freddy"; string ClientEmail = "*****@*****.**"; string ClientPosition = "CEO"; string ClientQualification = "degree"; string ClientService = "IT support for company"; string ClientAddress = ""; ClientAddress = ClientAddress.PadRight(49, '2'); string ClientTel = "783763"; string DateAdded = DateTime.Now.Date.ToString(); //invoke the method OK = AClient.Valid(ClientName, ClientEmail, ClientPosition, ClientQualification, ClientService, ClientAddress, ClientTel, DateAdded); //test to see that the result is correct Assert.IsTrue(OK); }
public void DateAddedMinPlusOne() { //create an instance of the class we want to create clsClient AClient = new clsClient(); //boolean variable to store the result of the validation Boolean OK = false; //create some test data to pass to the method string ClientName = "freddy"; string ClientEmail = "*****@*****.**"; string ClientPosition = "CEO"; string ClientQualification = "degree"; string ClientService = "IT support for company"; string ClientAddress = "21b"; string ClientTel = "783763"; DateTime TestDate; //set the date todays date TestDate = DateTime.Now.Date; //change the date to whatever the date is plus 1 day TestDate = TestDate.AddDays(1); //convert the date variable to a string variable string DateAdded = TestDate.ToString(); //invoke the method OK = AClient.Valid(ClientName, ClientEmail, ClientPosition, ClientQualification, ClientService, ClientAddress, ClientTel, DateAdded); //test to see that the result is correct Assert.IsFalse(OK); }