Exemple #1
0
        public void GetWorkingDayForClinic()
        {
            List <int> expected = new List <int> {
                1, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 31
            };
            List <int> actual = ClassGenerateCalendar.WorkingDaysInMonth(2021, 5);

            Assert.Equal(expected, actual);
        }
Exemple #2
0
        public void TestGenerationOfCalendar()
        {
            SqlCalendar sql      = new SqlCalendar();
            List <int>  expected = ClassGenerateCalendar.WorkingDaysInMonth(2000, 1);

            ClassGenerateCalendar.GenerateCalendar(2000, 1, sql);

            List <ClassCalendar>        list  = sql.CalendarList();
            IEnumerable <ClassCalendar> query =
                from elem in list
                where elem.Year == 2000 && elem.Month == 1
                select elem;

            Assert.Single(query);
            int calendarId = (query.First()).CalendarId;
            List <ClassCalendarDay> actual = sql.ListOfCalendarDays(calendarId);

            for (int i = 0; i < expected.Count; i++)
            {
                Assert.Equal(expected[i], actual[i].Day);
            }
        }