public void InstanceOk() { //create an isntance of the class we want to create clsCar ACar = new clsCar(); //test to see if it exists Assert.IsNotNull(ACar); }
public void ColourOk() { //create an isntance of the class we want to create clsCar ACar = new clsCar(); //create some test data to assaign to the property String TestData = "Blue"; //assign the data to the property ACar.Colour = TestData; //test to see that the two values are the same Assert.AreEqual(ACar.Colour, TestData); }
public void AgeOk() { //create an isntance of the class we want to create clsCar ACar = new clsCar(); //create some test data to assaign to the property int TestData = 30; //assign the data to the property ACar.Age = TestData; //test to see that the two values are the same Assert.AreEqual(ACar.Age, TestData); }
public void ActiveCaryOk() { //create an isntance of the class we want to create clsCar ACar = new clsCar(); //create some test data to assaign to the property Boolean TestData = true; //assign the data to the property ACar.Active = TestData; //test to see that the two values are the same Assert.AreEqual(ACar.Active, TestData); }
public void ValidMethodOK() { //create an instance of the class we want to create clsCar ACar = new clsCar(); //booleon variable to store teh result of the validation string Error = ""; //invoke the method Error = ACar.Valid(CarModel, CarMake, Colour, Mileage, BodyType, Age); //test to see if the result is correct Assert.AreEqual(Error, ""); }
public void MileageOK() { //create an isntance of the class we want to create clsCar ACar = new clsCar(); //create some test data to assign to the property Int32 TestData = 100000; //Assign the data to the property ACar.Mileage = TestData; //test to see that the two values are the same Assert.AreEqual(ACar.Mileage, TestData); }
public void AgeMid() { //create an instance of the class we want clsCar ACar = new clsCar(); //booleon variable to store the result of the validation string Error = ""; //create some data to assign to the property string Age = "50"; //invoke the method Error = ACar.Valid(CarModel, CarMake, Colour, Mileage, BodyType, Age); //test to see if the result is correct Assert.AreEqual(Error, ""); }
public void BodyTypeExtremeMax() { //create an instance of the class we want clsCar ACar = new clsCar(); //booleon variable to store the result of the validation string Error = ""; //create some data to assign to the property string BodyType = ""; //pad the data BodyType = BodyType.PadRight(50, 'j'); //invoke the method Error = ACar.Valid(CarModel, CarMake, Colour, Mileage, BodyType, Age); //test to see if the result is correct Assert.AreNotEqual(Error, ""); }