Exemple #1
0
            public void No_exception_is_being_thrown_but_an_invalid_result_is_being_returned()
            {
                var html = "INVALID DOC";

                var sut    = new CoursePageHtmlParser();
                var result = sut.TryParseCoursePage(html);

                result.IsSuccessful.ShouldBeFalse();
            }
Exemple #2
0
            public void Courses_without_examination_date_are_being_skipped(string courseId)
            {
                var html = GetDemoHtml();

                var sut    = new CoursePageHtmlParser();
                var result = sut.TryParseCoursePage(html);

                result.IsSuccessful.ShouldBeTrue();

                result.Value.Any(x => x.Id == courseId).ShouldBeFalse();
            }
Exemple #3
0
            public void Module_entries_are_being_skipped(string title)
            {
                var html = GetDemoHtml();

                var sut    = new CoursePageHtmlParser();
                var result = sut.TryParseCoursePage(html);

                result.IsSuccessful.ShouldBeTrue();

                result.Value.Any(x => x.Title == title).ShouldBeFalse();
            }
Exemple #4
0
            public void All_of_its_courses_are_being_returned(string title)
            {
                var html = GetDemoHtml();

                var sut    = new CoursePageHtmlParser();
                var result = sut.TryParseCoursePage(html);

                result.IsSuccessful.ShouldBeTrue();

                result.Value.Any(x => x.Title == title).ShouldBeTrue();
                result.Value.Length.ShouldBe(14);
            }
Exemple #5
0
            public void Its_attempts_are_set()
            {
                var html = GetDemoHtml();

                var sut    = new CoursePageHtmlParser();
                var result = sut.TryParseCoursePage(html);

                result.IsSuccessful.ShouldBeTrue();

                var imt102 = result.Value.Single(x => x.Title == "Mathematics II");

                imt102.Attempts.ShouldBe("4");
            }
Exemple #6
0
            public void Its_Date_of_Examination_is_set()
            {
                var html = GetDemoHtml();

                var sut    = new CoursePageHtmlParser();
                var result = sut.TryParseCoursePage(html);

                result.IsSuccessful.ShouldBeTrue();

                var imt102 = result.Value.Single(x => x.Title == "Mathematics II");

                imt102.DateOfExamination.ShouldBe("21.10.2017");
            }
Exemple #7
0
            public void Its_Status_is_set()
            {
                var html = GetDemoHtml();

                var sut    = new CoursePageHtmlParser();
                var result = sut.TryParseCoursePage(html);

                result.IsSuccessful.ShouldBeTrue();

                var imt101 = result.Value.Single(x => x.Title == "Mathematics I");

                imt101.Status.ShouldBe("P");
            }
Exemple #8
0
            public void Its_Module_is_set(string title, string module)
            {
                var html = GetDemoHtml();

                var sut    = new CoursePageHtmlParser();
                var result = sut.TryParseCoursePage(html);

                result.IsSuccessful.ShouldBeTrue();

                var course = result.Value.Single(x => x.Title == title);

                course.Module.ShouldBe(module);
            }
Exemple #9
0
            public void Its_Id_does_not_change()
            {
                var html = GetDemoHtml();

                var sut = new CoursePageHtmlParser();

                var id1 = sut.TryParseCoursePage(html).Value.Single(x => x.Title == "Mathematics I")
                          .Id;

                var id2 = sut.TryParseCoursePage(html).Value.Single(x => x.Title == "Mathematics I")
                          .Id;

                id2.Equals(id1).ShouldBeTrue();
            }