Example #1
0
        public void ValidateBookings_DifferentDayDifferentTime_ReturnsTrue()
        {
            LoadListBooking();
            ErrorObject result = ValidateBookng.IsValid(list_booking, "1", "03/09/2019", "03/09/2019", "11:30", "12:00");

            Assert.IsTrue(result.GetIsValid());
        }
Example #2
0
        public void ValidateBookings_FromDateMoreThanToDate_ReturnsFalse()
        {
            LoadListBooking();
            ErrorObject result = ValidateBookng.IsValid(list_booking, "1", "02/09/2019", "01/09/2019", "10:00", "11:00");

            Assert.IsFalse(result.GetIsValid());
        }
Example #3
0
        public void ValidateBookings_SamefromDateDifferentTodate_FromTimeEqualsInitialBookingToTime_ReturnsFalse()
        {
            LoadListBooking();

            ErrorObject result = ValidateBookng.IsValid(list_booking, "1", "02/09/2019", "02/10/2019", "11:00", "12:00");

            Assert.IsFalse(result.GetIsValid());
        }
Example #4
0
        public void ValidateBookings_SameDaySameTime_ReturnsFalse()
        {
            LoadListBooking();

            ErrorObject result = ValidateBookng.IsValid(list_booking, "1", "02/09/2019", "02/09/2019", "10:00", "11:00");

            Assert.IsFalse(result.GetIsValid());
        }
Example #5
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            Boolean res = ValidateOnlyNumbers();

            ErrorObject result = ValidateBookng.IsValid(ListBookings, lblVID.Text, dateTimePicker2.Text, dateTimePicker3.Text, dateTimePicker5.Text, dateTimePicker6.Text);


            if (result.GetIsValid() && res == true)
            {
                save_booking();
                MessageBox.Show(result.GetErrorMsg());

                LoadGrid();
            }
            else
            {
                MessageBox.Show(result.GetErrorMsg());
            }
        }