public void FindMethodOk() { //create an instance og the class we want to create clsCar AnCar = new clsCar(); //boolean variable to store the result of the valdation Boolean Found = false; //create some test data to use with the method Int32 CarID = 21; //invoke the method Found = AnCar.Find(CarID); //test to see that the result is correct Assert.IsTrue(Found); }
public void TestPriceFound() { //create an instnace of the class we want to create clsCar AnCar = new clsCar(); //boolean variable to store the result of the search Boolean Found = false; //boolean vairble to record if data is ok Boolean Ok = true; //create some test data to use with the method Int32 CarID = 21; //invoke the method Found = AnCar.Find(CarID); //check the car id if (AnCar.Price != 4576) { Ok = false; } //test to see that the result is correct Assert.IsTrue(Ok); }
public void TestFuelFound() { //create an instance of the class we want to create clsCar ACar = new clsCar(); //boolean variable to store the result of the search Boolean Found = false; // boolean variable to record if data is OK (assume it is) Boolean OK = true; //create some data to use with the method Int32 CarID = 8; //invoke the method Found = ACar.Find(CarID); //check the Car ID if (ACar.Fuel != true) { OK = false; } //test to see that the result is correct Assert.IsTrue(OK); }