public void TestCustomerNoFound() { //create an instance of the class we want to create clsCustomer ACustomer = new clsCustomer(); clsReview Review = new clsReview(); //boolean variable to find the result of the search Boolean Found = false; Boolean Look = false; //boolean variable to record if data is OK (assume it is) Boolean OK = true; //create some test data to use with the methods Int32 CustomerID = 3; Int32 ReviewID = 9; //invoke the method Found = ACustomer.Find(CustomerID); Look = Review.Find(ReviewID); if (ACustomer.CustomerID != 3) { OK = false; } if (Review.ReviewID != 9) { OK = false: } //test to see that the results are your desired outcome Assert.IsTrue(OK); }
public void FindMethodOK() { //create an instance of the class we want to create clsCustomer ACustomer = new clsCustomer(); clsReview Review = new clsReview(); //boolean to store the result of the validation Boolean Found = false; Boolean Look = false; //create some test data to use in the method Int32 CustomerID = 5; Int32 ReviewID = 4; //invoke the method Found = ACustomer.Find(CustomerID); Look = Review.Find(ReviewID); //test to see that the result is correct Assert.IsTrue(Found); Assert.IsTrue(Look); }