Welcome to mirror list, hosted at ThFree Co, Russian Federation.

AndroidTimeZonesTest.kt « ical4android « bitfire « at « java « androidTest « src - github.com/bitfireAT/ical4android.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d51c1adc8c627a005055fd250818f510ff713d38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/***************************************************************************************************
 * Copyright © All Contributors. See LICENSE and AUTHORS in the root directory for details.
 **************************************************************************************************/

package at.bitfire.ical4android

import org.junit.Assert
import org.junit.Assert.assertNotNull
import org.junit.Test
import java.time.ZoneId
import java.time.format.TextStyle
import java.util.*

class AndroidTimeZonesTest {

    @Test
    fun testLoadSystemTimezones() {
        for (id in ZoneId.getAvailableZoneIds()) {
            val name = ZoneId.of(id).getDisplayName(TextStyle.FULL, Locale.US)
            val info = try {
                DateUtils.ical4jTimeZone(id)
            } catch(e: Exception) {
                Assert.fail("Invalid system timezone $name ($id)")
            }
            if (info == null)
                assertNotNull("ical4j can't load system timezone $name ($id)", info)
        }
    }

}