Exemple #1
0
        public void HotelIdFound()
        {
            //creat an instance of clsBooking class
            clsBooking aBooking = new clsBooking();
            //boolean var to store the result of the validation
            Boolean Found = false;
            //boolean var to record if data is ok
            Boolean Ok = true;
            //create some test data to use with the method
            Int32 BookingID = 1;

            //invoke the method
            Found = aBooking.Find(BookingID);
            //chechk the data is num
            if (aBooking.HotelID != 1)
            {
                Ok = false;
            }
            //test to see that two values are same
            Assert.IsTrue(Ok);
        }
Exemple #2
0
        public void NumOfNightsExtreamMax()
        {
            //creat an instance of clsBooking class
            clsBooking aBooking = new clsBooking();
            //boolean var to store the result of the validation
            Boolean Ok = false;
            //var to store NumOfNights
            string NumOfNights;

            //asign some data to var
            NumOfNights = "1000";
            //var to store BookingDate
            string BookigDate = DateTime.Now.Date.ToString();
            //var to store checkInDate
            string CheckInDate = DateTime.Now.Date.ToString();
            //var to store CheckOutDate
            string CheckOutDate = DateTime.Now.Date.ToString();

            //invoke the method
            Ok = aBooking.Valid(NumOfNights, BookigDate, CheckInDate, CheckOutDate);
            //test to see that the result is correct
            Assert.IsFalse(Ok);
        }
Exemple #3
0
        public void ValidateMethodOk()
        {
            //creat an instance of clsBooking class
            clsBooking aBooking = new clsBooking();
            //boolean var to store the result of the validation
            Boolean Found = false;
            //var to store NumOfNights
            string NumOfNights;

            //asign some data to var
            NumOfNights = "1";
            //var to store BookingDate
            string BookigDate = DateTime.Now.Date.ToString();
            //var to store checkInDate
            string CheckInDate = DateTime.Now.Date.ToString();
            //var to store CheckOutDate
            string CheckOutDate = DateTime.Now.Date.ToString();

            //invoke the method
            Found = aBooking.Valid(NumOfNights, BookigDate, CheckInDate, CheckOutDate);
            //test to see that two values are same
            Assert.IsTrue(Found);
        }
Exemple #4
0
        public void CheckInDateDateInvalidData()
        {
            //creat an instance of clsBooking class
            clsBooking aBooking = new clsBooking();
            //boolean var to store the result of the validation
            Boolean Ok = false;
            //var to store NumOfNights
            string NumOfNights = "15";
            //create a var to store test data
            // DateTime TestDate;
            //asign some data to testdata
            //TestDate = DateTime.Now.Date.AddDays(100);
            //var to store BookingDate
            string BookigDate = DateTime.Now.Date.ToString();
            //var to store checkInDate
            string CheckInDate = "this is not a date";
            //var to store CheckOutDate
            string CheckOutDate = DateTime.Now.Date.ToString();

            //invoke the method
            Ok = aBooking.Valid(NumOfNights, BookigDate, CheckInDate, CheckOutDate);
            //test to see that the result is correct
            Assert.IsFalse(Ok);
        }