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(); }
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(); }
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(); }
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); }
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"); }
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"); }
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"); }
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); }
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(); }