44 * SPDX-License-Identifier: GPL-3.0-or-later
55 */
66
7- package at.bitfire.ical4android .validation
7+ package at.bitfire.synctools.icalendar .validation
88
99import org.junit.Assert.assertEquals
1010import org.junit.Assert.assertFalse
@@ -13,17 +13,19 @@ import org.junit.Test
1313import java.time.Duration
1414
1515class FixInvalidDayOffsetPreprocessorTest {
16+
17+ private val processor = FixInvalidDayOffsetPreprocessor ()
1618
1719 /* *
18- * Calls [FixInvalidDayOffsetPreprocessor .fixString] and asserts the result is equal to [expected].
20+ * Calls `processor .fixString` and asserts the result is equal to [expected].
1921 *
2022 * @param expected The expected result
2123 * @param testValue The value to test
2224 * @param parseDuration If `true`, [Duration.parse] is called on the fixed value to make sure it's a valid duration
2325 */
2426 private fun assertFixedEquals (expected : String , testValue : String , parseDuration : Boolean = true) {
2527 // Fix the duration string
26- val fixed = FixInvalidDayOffsetPreprocessor .fixString(testValue)
28+ val fixed = processor .fixString(testValue)
2729
2830 // Test the duration can now be parsed
2931 if (parseDuration)
@@ -40,7 +42,7 @@ class FixInvalidDayOffsetPreprocessorTest {
4042 fun test_FixString_NoOccurrence () {
4143 assertEquals(
4244 " Some String" ,
43- FixInvalidDayOffsetPreprocessor .fixString(" Some String" ),
45+ processor .fixString(" Some String" ),
4446 )
4547 }
4648
@@ -99,14 +101,14 @@ class FixInvalidDayOffsetPreprocessorTest {
99101
100102 @Test
101103 fun test_RegexpForProblem_DayOffsetTo_Invalid () {
102- val regex = FixInvalidDayOffsetPreprocessor .regexpForProblem()
104+ val regex = processor .regexpForProblem()
103105 assertTrue(regex.matches(" DURATION:PT2D" ))
104106 assertTrue(regex.matches(" TRIGGER:PT1D" ))
105107 }
106108
107109 @Test
108110 fun test_RegexpForProblem_DayOffsetTo_Valid () {
109- val regex = FixInvalidDayOffsetPreprocessor .regexpForProblem()
111+ val regex = processor .regexpForProblem()
110112 assertFalse(regex.matches(" DURATION:-PT12H" ))
111113 assertFalse(regex.matches(" TRIGGER:-PT15M" ))
112114 }
0 commit comments