package nerd.tuxmobil.fahrplan.congress.models

import org.assertj.core.api.Assertions.assertThat
import org.junit.Test

class LectureTest {

    @Test
    fun getStartTimeMoment() {
        val lecture = Lecture("1")
        lecture.relStartTime = 121
        lecture.date = "2019-12-27"

        val moment = lecture.startTimeMoment
        assertThat(moment.minute).isEqualTo(1)
        assertThat(moment.minuteOfDay).isEqualTo(121)
        assertThat(moment.hour).isEqualTo(2)
        assertThat(moment.month).isEqualTo(12)
        assertThat(moment.monthDay).isEqualTo(27)
        assertThat(moment.year).isEqualTo(2019)
    }

    @Test
    fun `getLectureStartTime returns the "dateUTC" value when "dateUTC" is set`() {
        val lecture = Lecture("1").apply {
            dateUTC = 1
            date = "2020-03-20"
        }
        assertThat(lecture.startTimeMilliseconds).isEqualTo(1)
    }

    @Test
    fun `getLectureStartTime returns the "date" value when "dateUTC" is not set`() {
        val lecture = Lecture("1").apply {
            dateUTC = 0
            date = "2020-03-20"
        }
        assertThat(lecture.startTimeMilliseconds).isEqualTo(1584662400000L)
    }

}

package nerd.tuxmobil.fahrplan.congress.models

import org.assertj.core.api.Assertions.assertThat
import org.junit.Test

class LectureTest {

    @Test
    fun getStartTimeMoment() {
        val lecture = Lecture("1")
        lecture.relStartTime = 121
        lecture.date = "2019-12-27"

        val moment = lecture.startTimeMoment
        assertThat(moment.minute).isEqualTo(1)
        assertThat(moment.minuteOfDay).isEqualTo(121)
        assertThat(moment.hour).isEqualTo(2)
        assertThat(moment.month).isEqualTo(12)
        assertThat(moment.monthDay).isEqualTo(27)
        assertThat(moment.year).isEqualTo(2019)
    }

    @Test
    fun `startTimeMilliseconds returns the "dateUTC" value when "dateUTC" is set`() {
        val lecture = Lecture("1").apply {
            dateUTC = 1
            date = "2020-03-20"
        }
        assertThat(lecture.startTimeMilliseconds).isEqualTo(1)
    }

    @Test
    fun `startTimeMilliseconds returns the "date" value when "dateUTC" is not set`() {
        val lecture = Lecture("1").apply {
            dateUTC = 0
            date = "2020-03-20"
        }
        assertThat(lecture.startTimeMilliseconds).isEqualTo(1584662400000L)
    }

}

Update test method names to match the name of the property under test.
Update test method names to match the name of the property under test.

+ Left-over from: 88f301f110564f5bbf72d2128f853ccf0829a131.

EventFahrplan/EventFahrplan,EventFahrplan/EventFahrplan