public void ValidMethod() { //create an instance of the class we want to create clsProduct AProduct = new clsProduct(); //string variable to store any error message String Error = ""; //invoke the method Error = AProduct.Valid(Name, Price, Description); //test to see that the result is correct Assert.AreEqual(Error, ""); }
public void DescriptionMid() { //create an instance of the class we want to create clsProduct AProduct = new clsProduct(); //string variable to store any error message String Error = ""; //create some test data to pass to the method //this should pass string Description = ""; Description = Description.PadRight(25, 'a'); //invoke the method Error = AProduct.Valid(Name, Price, Description); //test to see that the result is correct Assert.AreEqual(Error, ""); }