//used to test the valid method of the class public void ValidMethod() { //create an instance of a class clsPlane APlane = new clsPlane(); //create a string variable to store the result of the validation string Error = ""; //create some test data to test the method Error = APlane.Valid(SomePlaneName, SomeHoursFly); //test to see the result is ok. i.e there was no error mssage returned Assert.AreEqual(Error, ""); }
public void HoursFlyMaxPlusOne() { //create an instance of a class clsPlane APlane = new clsPlane(); //create a string variable to store the result of the validation string Error = ""; //create some test data to test the method string SomeHoursFly = "12345"; //invoke the method Error = APlane.Valid(SomePlaneName, SomeHoursFly); //Test to see that the result is not ok. i.e there should be an error message Assert.AreNotEqual(Error, ""); }
public void HoursFlyExtremeMax() { //create an instance of a class clsPlane APlane = new clsPlane(); //create a string variable to store the result of the validation string Error = ""; //create some test data to test the method string SomeHoursFly = ""; //pad the string with characters SomeHoursFly = SomePlaneName.PadRight(10, 'a'); //invoke the method Error = APlane.Valid(SomeHoursFly, SomeHoursFly); //Test to see that the result is not ok. i.e there should be an error message Assert.AreNotEqual(Error, ""); }