public void DeleteMethodOK() { //create instance of the class we want to create clsConsoleCollection AllConsoles = new clsConsoleCollection(); clsConsole TestItem = new clsConsole(); Int32 PrimaryKey = 0; //sets properties TestItem.ConsoleNo = 1; TestItem.Name = "Xbox"; TestItem.Manufacturer = "Microsoft"; TestItem.Price = 250; TestItem.Stock = 10000; AllConsoles.ThisConsole = TestItem; //add record PrimaryKey = AllConsoles.Add(); TestItem.ConsoleNo = PrimaryKey; AllConsoles.ThisConsole.Find(PrimaryKey); AllConsoles.Delete(); //finds record Boolean Found = AllConsoles.ThisConsole.Find(PrimaryKey); //tests to see that record was not found Assert.IsFalse(Found); }
void DeleteAddress() { //function to delete selected record clsConsoleCollection Console = new clsConsoleCollection(); //find record to delete Console.ThisConsole.Find(ConsoleNo); //delete record Console.Delete(); }