Int32 DisplayTicket(string TicketNoFilter)
    {
        //var to store the TicketNo
        string TicketNo;
        //create an instance of the Orderline collection class
        clsTicketCollection Ticket = new clsTicketCollection();

        Ticket.ReportByTicketNo(TicketNoFilter);
        //var to store the count of records
        Int32 RecordCount;
        //var to store the index for the loop
        Int32 Index = 0;

        //get the count of records
        RecordCount = Ticket.Count;
        //clear the list box
        lstTicket.Items.Clear();
        //while there are records
        while (Index < RecordCount)
        {
            //get the Ticket no
            TicketNo = Ticket.TicketList[Index].TicketNo;
            //create a new entry for the list box
            ListItem NewEntry = new ListItem(TicketNo + " ".ToString());
            //add the staff to the list
            lstTicket.Items.Add(NewEntry);
            //move the index to the next record
            Index++;
        }
        //return to the count of records found
        return(RecordCount);
    }
        public void ReportByTicketNoTestDataFound()
        {
            //create an instance of the filtered data
            clsTicketCollection FilteredTicket = new clsTicketCollection();
            //var to store outcome
            Boolean OK = true;

            //apply a name that does not exist
            FilteredTicket.ReportByTicketNo("test1");
            //check that the correct number of records are found
            if (FilteredTicket.Count == 2)
            {
                //Check that the first record is ID 7
                if (FilteredTicket.TicketList[0].TicketID != 7)
                {
                    OK = false;
                }
                //Check that the first record is ID 9
                if (FilteredTicket.TicketList[1].TicketID != 9)
                {
                    OK = false;
                }
            }
            else
            {
                OK = false;
            }
            //test to see that there are no record
            Assert.IsTrue(OK);
        }
        public void ReportByTicketNoNoneFound()
        {
            //create an instance of the class containing unfiltered results
            clsTicketCollection FilteredTicket = new clsTicketCollection();

            //apply a ticket no that doesnt exist
            FilteredTicket.ReportByTicketNo("XXXXXX");
            //test to see that there are no records
            Assert.AreEqual(0, FilteredTicket.Count);
        }
        public void ReportByTicketNo()
        {
            //create an instance of the class containing unfiltered results
            clsTicketCollection AllTicket = new clsTicketCollection();
            //create an instance of the filtered data
            clsTicketCollection FilteredTicket = new clsTicketCollection();

            //apply a blank string (should return all records)
            FilteredTicket.ReportByTicketNo("");
            //test to see that the two values are the same
            Assert.AreEqual(AllTicket.Count, FilteredTicket.Count);
        }