Add a summary of attendance (#132)

This commit is contained in:
Rafał Borcz
2018-12-07 19:01:19 +01:00
committed by Mikołaj Pich
parent 900065d758
commit f96d0ebed9
65 changed files with 1351 additions and 126 deletions

View File

@ -1,10 +1,13 @@
package io.github.wulkanowy.utils
import org.junit.Assert.*
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test
import org.threeten.bp.LocalDate
import org.threeten.bp.LocalDateTime
import java.util.*
import org.threeten.bp.Month.JANUARY
import java.util.Locale
class TimeExtensionTest {
@ -43,6 +46,14 @@ class TimeExtensionTest {
assertEquals(LocalDate.of(2018, 10, 12), LocalDate.of(2018, 10, 8).friday)
}
@Test
fun monthNameTest() {
Locale.setDefault(Locale.forLanguageTag("PL"))
assertEquals("Styczeń", JANUARY.getFormattedName())
Locale.setDefault(Locale.forLanguageTag("US"))
assertEquals("January", JANUARY.getFormattedName())
}
@Test
fun weekDayNameTest() {
Locale.setDefault(Locale.forLanguageTag("PL"))
@ -74,7 +85,6 @@ class TimeExtensionTest {
assertEquals(LocalDate.of(2018, 10, 3), LocalDate.of(2018, 10, 4).previousSchoolDay)
}
@Test
fun nextOrSameSchoolDayTest() {
assertEquals(LocalDate.of(2018, 9, 28), LocalDate.of(2018, 9, 28).nextOrSameSchoolDay)