package com.rj.util;

import org.junit.jupiter.api.Test;

import java.time.LocalDate;

import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

class IsoWorkdayUtilsTest {

    @Test
    void may162026_isSaturday_weekend() {
        LocalDate d = LocalDate.of(2026, 5, 16);
        assertTrue(IsoWorkdayUtils.isWeekend(d), () -> "expected weekend, isoDow=" + IsoWorkdayUtils.isoDayOfWeek(d));
    }

    @Test
    void may172026_isSunday_weekend() {
        assertTrue(IsoWorkdayUtils.isWeekend(LocalDate.of(2026, 5, 17)));
    }

    /** 同年月日不同年份：2024-05-16 为周四，勿与 2026-05-16（周六）混淆。 */
    @Test
    void may162024_isThursday_notWeekend() {
        LocalDate d = LocalDate.of(2024, 5, 16);
        assertFalse(IsoWorkdayUtils.isWeekend(d), () -> "expected weekday, isoDow=" + IsoWorkdayUtils.isoDayOfWeek(d));
    }
}
