Exemplo n.º 1
0
    void DisplayBooking(Int32 BookingNo)
    {
        //instance of booking clas
        clsBookings BookingList = new clsBookings();

        //find record to display
        BookingList.Find(BookingNo);
        //display the data
        txtCustomerNo.Text     = BookingList.CustomerNo.ToString();
        txtTourNo.Text         = BookingList.TourNo.ToString();
        txtDateandTime.Text    = BookingList.DateandTime.ToShortDateString();
        txtPassengerCount.Text = BookingList.PassengerCount.ToString();
    }
        public void FindMethodOK()
        {
            //create a new instance of the class we want to create
            clsBookings ABookings = new clsBookings();
            //string variable to store result of validation
            Boolean Found = false;
            //create some test data to assign to property
            Int32 BookRef = 1;

            //invoke method
            Found = ABookings.Find(BookRef);
            //test to see if it exists
            Assert.IsTrue(Found);
        }
Exemplo n.º 3
0
        public void FindMethodOK()
        {
            //create an instance of booking class
            clsBookings ABooking = new clsBookings();
            //boolean variable to store the result of the validation
            Boolean Found = false;
            //create some tsest data to use with the method
            Int32 BookingNo = 1;

            //invoke the method
            Found = ABooking.Find(BookingNo);
            //test to see that the result is correct
            Assert.IsTrue(Found);
        }
        public void TestFKCustIdFound()
        {
            //create a new instance of the class we want to create
            clsBookings ABookings = new clsBookings();
            //string variable to store result of validation
            Boolean Found = false;
            //bolean value if data is OK (assume it is)
            Boolean OK = true;
            //create some test data to assign to property
            Int32 BookRef = 1;

            //invoke method
            Found = ABookings.Find(BookRef);
            //check the booking no
            if (ABookings.CustID != 2)
            {
                OK = false;
            }
            //test to see if it exists
            Assert.IsTrue(OK);
        }
Exemplo n.º 5
0
        public void TestPassengerCountFound()
        {
            //instance of booking class
            clsBookings ABooking = new clsBookings();
            //boolean variable to store the result to the search
            Boolean Found = false;
            //boolean variable to record if data is ok
            Boolean OK = true;
            //create some test data to use with the method
            Int32 BookingNo = 21;

            //invoke the method
            Found = ABooking.Find(BookingNo);
            //check the property
            if (ABooking.PassengerCount != 21)
            {
                OK = false;
            }
            //test the result
            Assert.IsTrue(OK);
        }
Exemplo n.º 6
0
        public void TestDateandTimeFound()
        {
            //instance of booking class
            clsBookings ABooking = new clsBookings();
            //boolean variable to store the result to the search
            Boolean Found = false;
            //boolean variable to record if data is ok
            Boolean OK = true;
            //test data to use with the method
            Int32 BookingNo = 21;

            //invoke the method
            Found = ABooking.Find(BookingNo);
            //check the property
            if (ABooking.DateandTime != Convert.ToDateTime("01/01/2010"))
            {
                OK = false;
            }
            //test the result
            Assert.IsTrue(OK);
        }
Exemplo n.º 7
0
        public void TestBookingNoFound()
        {
            //instance of booking class
            clsBookings ABooking = new clsBookings();
            //boolean variable to store the search result
            Boolean Found = false;
            //boolean variable to record if data is ok
            Boolean OK = true;
            //test data to use with teh method
            Int32 BookingNo = 21;

            //invoke the method
            Found = ABooking.Find(BookingNo);
            //check the bookingno
            if (ABooking.BookingNo != 21)
            {
                OK = false;
            }
            //test to see that the result is correct]
            Assert.IsTrue(OK);
        }