Ejemplo n.º 1
0
        public void ScheduleSearch_InvalidFixDateInput_ReturnsAreNotEqual()
        {
            var    ss         = new SearchScheduleDate();
            string dateString = ss.FixDateInput("april", "26", "2020");

            Assert.AreNotEqual(dateString, "april-26-2020");
        }
Ejemplo n.º 2
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            var message = new UserMessage();

            string month = txtMonth.Text;
            string day   = txtDay.Text;
            string year  = txtYear.Text;

            var      ss             = new SearchScheduleDate();
            string   dateString     = ss.FixDateInput(month, day, year);
            var      validReturns   = ss.CheckIfValidDate(dateString);
            bool     validDate      = validReturns.Item1;
            int      daysDifference = validReturns.Item2;
            DateTime dateTime       = validReturns.Item3;

            if (validDate)
            {
                CurrentDayViewed = daysDifference;
                GetScheduledAppointments();

                SetupTextBoxes();

                message.Show($"Your {dateTime.ToShortDateString()} has been searched successfully.");
            }
            else
            {
                message.Show($"Your input of {dateString} is not a valid date.");
            }
        }