use super::{
    local_to_utc,
    test::{datetime_naive, datetime_utc},
};

#[test]
fn should_convert_from_utc_plus_one() {
    let date_time_utc = local_to_utc(
        chrono_tz::Tz::Europe__Amsterdam,
        datetime_naive("2025-12-18", "11:00:00"),
    )
    .unwrap();

    assert_eq!(date_time_utc, datetime_utc("2025-12-18", "10:00:00"));
}

#[test]
fn should_choose_earliest_date_from_dst_end_fold() {
    // The end of DST in NL.
    let date_time_utc = local_to_utc(
        chrono_tz::Tz::Europe__Amsterdam,
        datetime_naive("2025-10-26", "02:59:59"),
    )
    .unwrap();

    assert_eq!(date_time_utc, datetime_utc("2025-10-26", "00:59:59"));
}

#[test]
fn should_return_none_on_dst_begin_gap() {
    // The beginning of DST in NL.
    let date_time_utc = local_to_utc(
        chrono_tz::Tz::Europe__Amsterdam,
        datetime_naive("2025-03-30", "02:00:00"),
    );

    assert_eq!(date_time_utc, None);
}
