aboutsummaryrefslogtreecommitdiff
path: root/src/test/kotlin/util/skyblock/TimestampTest.kt
blob: b960cb9644fc231700ed081f316604bf2cb0d3ef (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
package moe.nea.firmament.test.util.skyblock

import java.time.Instant
import java.time.ZonedDateTime
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
import moe.nea.firmament.test.testutil.ItemResources
import moe.nea.firmament.util.SBData
import moe.nea.firmament.util.timestamp

class TimestampTest {

	@Test
	fun testLongTimestamp() {
		Assertions.assertEquals(
			Instant.ofEpochSecond(1658091600),
			ItemResources.loadItem("hyperion").timestamp
		)
	}

	@Test
	fun testStringTimestamp() {
		Assertions.assertEquals(
			ZonedDateTime.of(2021, 10, 11, 15, 39, 0, 0, SBData.hypixelTimeZone).toInstant(),
			ItemResources.loadItem("backpack-in-menu").timestamp
		)
	}
}