TimetableParser: parse year
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				continuous-integration/woodpecker the build was successful
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	continuous-integration/woodpecker the build was successful
				
			This also adds the parsed year to the meta object included in the timetable response
This commit is contained in:
		| @ -25,6 +25,7 @@ package org.mosad.thecitadelofricks.hsoparser | ||||
| import org.jsoup.Jsoup | ||||
| import org.junit.jupiter.api.Assertions | ||||
| import org.junit.jupiter.api.Test | ||||
| import org.mosad.thecitadelofricks.CalendarWeek | ||||
| import java.io.File | ||||
|  | ||||
| class TimetableParserTest { | ||||
| @ -50,11 +51,11 @@ class TimetableParserTest { | ||||
|     } | ||||
|  | ||||
|     @Test | ||||
|     fun parseWeekNumberYear() { | ||||
|     fun parseCalendarWeek() { | ||||
|         val htmlFile = File(TimetableParserTest::class.java.getResource("/html/Timetable_normal-week.html").path) | ||||
|         val htmlDoc = Jsoup.parse(htmlFile, "UTF-8", "https://www.hs-offenburg.de/") | ||||
|         val actualWeekNumberYear = TimetableParser(htmlDoc = htmlDoc).parseWeekNumberYear() | ||||
|         val actualCalendarWeek = TimetableParser(htmlDoc = htmlDoc).parseCalendarWeek() | ||||
|  | ||||
|         Assertions.assertEquals(42, actualWeekNumberYear) | ||||
|         Assertions.assertEquals(CalendarWeek(42, 2019), actualCalendarWeek) | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user