Example #1
0
        public void Schedule20150209Test()
        {
            // arrange
            const int year = 2015;

            var expectedItem0 = new ScheduleItem()
            {
                Start    = new DateTime(year, 02, 10, 8, 0, 0),
                End      = new DateTime(year, 02, 10, 17, 30, 0),
                Location = "Flamingo's"
            };

            var expectedItem1 = new ScheduleItem()
            {
                Start    = new DateTime(year, 02, 13, 9, 0, 0),
                End      = new DateTime(year, 02, 13, 18, 30, 0),
                Location = "Panda's"
            };

            // act
            var htmlContent   = GetFileContent("20150209_rooster.txt");
            var contentParser = new ScheduleParser(htmlContent, year);
            var schedule      = contentParser.GetScheduleFromContent();

            // assert
            Assert.That(schedule, Is.Not.Null);
            Assert.That(schedule.Count(), Is.EqualTo(2));
            AssertSchedule(schedule[0], expectedItem0);
            AssertSchedule(schedule[1], expectedItem1);
        }
Example #2
0
        public void Schedule2020Page0Test()
        {
            // arrange
            const int YEAR = 2020;

            var expectedItem0 = new ScheduleItem
            {
                Start    = new DateTime(YEAR, 12, 07, 8, 30, 0),
                End      = new DateTime(YEAR, 12, 07, 18, 0, 0),
                Location = "Aapjes",
            };

            var expectedItem1 = new ScheduleItem
            {
                Start    = new DateTime(YEAR, 12, 08, 7, 45, 0),
                End      = new DateTime(YEAR, 12, 08, 14, 30, 0),
                Location = "Aapjes",
            };

            var expectedItem2 = new ScheduleItem
            {
                Start    = new DateTime(YEAR, 12, 08, 14, 30, 0),
                End      = new DateTime(YEAR, 12, 08, 17, 30, 0),
                Location = "Verhuizing groepen",
            };

            var expectedItem3 = new ScheduleItem
            {
                Start    = new DateTime(YEAR, 12, 09, 16, 30, 0),
                End      = new DateTime(YEAR, 12, 09, 18, 30, 0),
                Location = "Verhuizing groepen",
            };

            // act
            var htmlContent   = GetFileContent("2020/page_0.txt");
            var contentParser = new ScheduleParser(NullLogger.Instance);
            var schedule      = contentParser.GetScheduleFromContent(htmlContent, YEAR).ToList();

            // assert
            Assert.NotNull(schedule);
            Assert.Equal(4, schedule.Count);
            AssertSchedule(schedule[0], expectedItem0);
            AssertSchedule(schedule[1], expectedItem1);
            AssertSchedule(schedule[2], expectedItem2);
            AssertSchedule(schedule[3], expectedItem3);
        }
Example #3
0
        public void Schedule201508Test()
        {
            // arrange
            const int year = 2015;

            var expectedItem0 = new ScheduleItem
            {
                Start    = new DateTime(year, 02, 16, 8, 0, 0),
                End      = new DateTime(year, 02, 16, 13, 15, 0),
                Location = "Zebra's"
            };

            var expectedItem1 = new ScheduleItem
            {
                Start    = new DateTime(year, 02, 16, 13, 45, 0),
                End      = new DateTime(year, 02, 16, 17, 30, 0),
                Location = "Krokodillen"
            };

            var expectedItem2 = new ScheduleItem
            {
                Start    = new DateTime(year, 02, 17, 8, 0, 0),
                End      = new DateTime(year, 02, 17, 17, 30, 0),
                Location = "Flamingo's"
            };

            var expectedItem3 = new ScheduleItem
            {
                Start    = new DateTime(year, 02, 20, 9, 0, 0),
                End      = new DateTime(year, 02, 20, 18, 30, 0),
                Location = "Panda's"
            };

            // act
            var htmlContent   = GetFileContent("2015-08.html");
            var contentParser = new ScheduleParser(htmlContent, year);
            var schedule      = contentParser.GetScheduleFromContent();

            // assert
            Assert.That(schedule, Is.Not.Null);
            Assert.That(schedule.Count(), Is.EqualTo(4));
            AssertSchedule(schedule[0], expectedItem0);
            AssertSchedule(schedule[1], expectedItem1);
            AssertSchedule(schedule[2], expectedItem2);
            AssertSchedule(schedule[3], expectedItem3);
        }
Example #4
0
        public void Schedule20141212Test()
        {
            // arrange
            const int year = 2014;

            var expectedItem0 = new ScheduleItem()
            {
                Start    = new DateTime(year, 12, 08, 9, 0, 0),
                End      = new DateTime(year, 12, 08, 13, 30, 0),
                Location = "Boventallig werken, mentor en inwerken"
            };

            var expectedItem1 = new ScheduleItem()
            {
                Start    = new DateTime(year, 12, 08, 14, 0, 0),
                End      = new DateTime(year, 12, 08, 17, 30, 0),
                Location = "Boventallig werken, mentor en inwerken"
            };

            var expectedItem2 = new ScheduleItem()
            {
                Start    = new DateTime(year, 12, 11, 11, 0, 0),
                End      = new DateTime(year, 12, 11, 12, 30, 0),
                Location = "Boventallig werken, mentor en inwerken"
            };

            // act
            var htmlContent   = GetFileContent("20141212_rooster.txt");
            var contentParser = new ScheduleParser(htmlContent, year);
            var schedule      = contentParser.GetScheduleFromContent();

            // assert
            Assert.That(schedule, Is.Not.Null);
            Assert.That(schedule.Count(), Is.EqualTo(3));
            AssertSchedule(schedule[0], expectedItem0);
            AssertSchedule(schedule[1], expectedItem1);
            AssertSchedule(schedule[2], expectedItem2);
        }