Loading src/test/kotlin/at/bitfire/dav4jvm/property/CalendarDescriptionTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ import org.junit.Test class CalendarDescriptionTest: PropertyTest() { @Test fun testSource() { fun testCalendarDescription() { val results = parseProperty("<calendar-description xmlns=\"urn:ietf:params:xml:ns:caldav\">My Calendar</calendar-description>") val result = results.first() as CalendarDescription assertEquals("My Calendar", result.description) Loading src/test/kotlin/at/bitfire/dav4jvm/property/OwnerTest.kt +9 −2 Original line number Diff line number Diff line Loading @@ -7,14 +7,21 @@ import org.junit.Test class OwnerTest: PropertyTest() { @Test fun testOwner_WithoutHref() { fun testOwner_PlainText() { val results = parseProperty("<owner xmlns=\"DAV:\">https://example.com</owner>") val owner = results.first() as Owner assertNull(owner.href) } @Test fun testOwner_OneHref() { fun testOwner_PlainTextAndHref() { val results = parseProperty("<owner xmlns=\"DAV:\">Principal Name. <href>mailto:owner@example.com</href> (test)</owner>") val owner = results.first() as Owner assertEquals("mailto:owner@example.com", owner.href) } @Test fun testOwner_Href() { val results = parseProperty("<owner xmlns=\"DAV:\"><href>https://example.com</href></owner>") val owner = results.first() as Owner assertEquals("https://example.com", owner.href) Loading Loading
src/test/kotlin/at/bitfire/dav4jvm/property/CalendarDescriptionTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ import org.junit.Test class CalendarDescriptionTest: PropertyTest() { @Test fun testSource() { fun testCalendarDescription() { val results = parseProperty("<calendar-description xmlns=\"urn:ietf:params:xml:ns:caldav\">My Calendar</calendar-description>") val result = results.first() as CalendarDescription assertEquals("My Calendar", result.description) Loading
src/test/kotlin/at/bitfire/dav4jvm/property/OwnerTest.kt +9 −2 Original line number Diff line number Diff line Loading @@ -7,14 +7,21 @@ import org.junit.Test class OwnerTest: PropertyTest() { @Test fun testOwner_WithoutHref() { fun testOwner_PlainText() { val results = parseProperty("<owner xmlns=\"DAV:\">https://example.com</owner>") val owner = results.first() as Owner assertNull(owner.href) } @Test fun testOwner_OneHref() { fun testOwner_PlainTextAndHref() { val results = parseProperty("<owner xmlns=\"DAV:\">Principal Name. <href>mailto:owner@example.com</href> (test)</owner>") val owner = results.first() as Owner assertEquals("mailto:owner@example.com", owner.href) } @Test fun testOwner_Href() { val results = parseProperty("<owner xmlns=\"DAV:\"><href>https://example.com</href></owner>") val owner = results.first() as Owner assertEquals("https://example.com", owner.href) Loading