public void DeleteMethodOK() { // create an instance for the class we want to create clsSupportCollection AllSupport = new clsSupportCollection(); // create the item of the test data clsSupport TestItem = new clsSupport(); // var to store the primary key Int32 PrimaryKey = 0; // set it properties TestItem.SupportId = 2; TestItem.Email = "*****@*****.**"; TestItem.Name = "GoGo Pro"; TestItem.Description = "A new invention in Camera module"; TestItem.Phonenum = "11111111111"; TestItem.DateSubmitted = DateTime.Now.Date; // set thisAdress to the test data AllSupport.ThisSupport = TestItem; // add the record PrimaryKey = AllSupport.Add(); // set the primary key TestI data TestItem.SupportId = PrimaryKey; // find the record AllSupport.ThisSupport.Find(PrimaryKey); // delete the record AllSupport.Delete(); //now find the record Boolean Found = AllSupport.ThisSupport.Find(PrimaryKey); // test to see that the record was not found Assert.IsFalse(Found); }
void DeleteSupport() { //function to delete the selected record //create an instance of the Support Collection clsSupportCollection AllSupports = new clsSupportCollection(); //find the record to delete AllSupports.ThisSupport.Find(mSupportId); //delete the record AllSupports.Delete(); }