public void TestDescriptionFound() { //create an instance of the class we want to create clsProduct AProduct = new clsProduct(); //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 test data to use with the method Int32 ProductID = 2; //invoke the mehtod Found = AProduct.Find(ProductID); //check the Product Description if (AProduct.Description != "Grey, Medium") { Int32 ProductID = 2; } //invoke the mehtod Found = AProduct.Find(ProductID); //check the address no if (AProduct.Description != "Grey, Medium") { Int32 ProductID = 2; } //invoke the mehtod Found = AProduct.Find(ProductID); //check the Product Description if (AProduct.Description != "Grey, Medium") { OK = false; } //test to see that the result is correct Assert.IsTrue(OK); }
public void FindMethodOK() { //create an instance of the class we want to create clsProduct AProduct = new clsProduct(); //bollean variable to store the results of the validation Boolean found = false; //create some text data to use with method Int32 ProductID = 1; Int32 ProductID = 1; Int32 ProductID = 1; //invoke the mehtod found = AProduct.Find(ProductID); //test to see if the results is true Assert.IsTrue(found); }