package market.guess.ui.desktop; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import market.guess.ui.desktop.util.Charts; import org.junit.jupiter.api.Test; class ChartsTest { @Test void testToEpochSecondFromIndex() { double t0 = Charts.toEpochSecond(0); double t1 = Charts.toEpochSecond(1); double t2 = Charts.toEpochSecond(2); assertEquals(Charts.BASE_TIME, t0, 1e-6); assertEquals(Charts.BASE_TIME + 1800, t1, 1e-6); assertEquals(Charts.BASE_TIME + 3600, t2, 1e-6); } @Test void testToEpochSecondIdempotentForTimestamps() { long epoch = 1_700_000_000L; assertEquals(epoch, Charts.toEpochSecond(epoch), 1e-6); } @Test void testBaseTimeIsReasonable() { assertTrue(Charts.BASE_TIME > 1_700_000_000L); } }