public void ValidateMethodOK() { //Create an instance of the class we want to create clsTicketCollection AllTickets = new clsTicketCollection(); //Create the item of test data clsTicket TestItem = new clsTicket(); //Variable to store the primary kjey Int32 PrimaryKey = 0; //Set its properties TestItem.CustomerID = 1; TestItem.ScreeningID = 1; TestItem.Validated = false; TestItem.Cancelled = false; //Set ThisFilm to the test data AllTickets.ThisTicket = TestItem; //Add the record PrimaryKey = AllTickets.Add(); //Set the primary key of the test data TestItem.TicketID = PrimaryKey; //Cancel the record AllTickets.Validate(); //Find the record AllTickets.ThisTicket.Find(PrimaryKey); //Test to see that the Ticket has been validated Assert.IsTrue(TestItem.Validated); }