public void BlogMaxLessOne() { //create an instance of the class we want to create clsAdmin AAdmin = new clsAdmin(); //string variable to store any error message String Error = ""; //create some test data to pass to the method string Blog = "Blog1"; Blog = Blog.PadRight(99, 'a'); AdminEmail = "*****@*****.**"; AdminNo = "12345"; FirstName = "FirstName"; LastName = "Last name"; //invoke the method Error = AAdmin.Valid(AdminNo, AdminEmail, FirstName, LastName, Blog); //test to see that the result is correct Assert.AreNotEqual(Error, ""); }
public void AdminEmailMax() { //create an instance of the class we want to create clsAdmin AAdmin = new clsAdmin(); //string variable to store any error message String Error = ""; //create some test data to pass to the method string AdminEmail = "*****@*****.**"; AdminEmail = AdminEmail.PadRight(50, 'a'); AdminNo = "12345"; Blog = "test"; LastName = "Last name"; FirstName = "First name"; //invoke method //AdminNo = AdminEmail.PadRight(500, 'a'); //this should fail //test to see that the result is correct Error = AAdmin.Valid(AdminNo, AdminEmail, FirstName, LastName, Blog); //test to see that the result is correct Assert.AreNotEqual(Error, ""); }