package com.andrewlalis.perfin.data;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;

public class TimestampRangeTest {
    @Test
    public void testLastNDays() {
        TimestampRange r = TimestampRange.lastNDays(1);
        assertEquals(r.start(), r.end().minusDays(1));
        r = TimestampRange.lastNDays(42);
        assertEquals(r.start(), r.end().minusDays(42));
    }

    @Test
    public void testLastNMonths() {
        TimestampRange r = TimestampRange.lastNMonths(1);
        assertEquals(r.start(), r.end().minusMonths(1));
    }
}
