package com.magistr.app.utils;

import org.junit.jupiter.api.Test;

import java.time.LocalDate;

import static org.assertj.core.api.Assertions.assertThat;

class CourseAndSemesterCalculatorTest {

    @Test
    void courseAndSemesterAreZeroBeforeStudyStart() {
        LocalDate date = LocalDate.of(2026, 5, 1);

        assertThat(CourseAndSemesterCalculator.getActualCourse(2027, date)).isZero();
        assertThat(CourseAndSemesterCalculator.getActualSemester(2027, date)).isZero();
    }

    @Test
    void septemberStartsFirstCourseAndFirstSemester() {
        LocalDate date = LocalDate.of(2026, 9, 1);

        assertThat(CourseAndSemesterCalculator.getActualCourse(2026, date)).isEqualTo(1);
        assertThat(CourseAndSemesterCalculator.getActualSemester(2026, date)).isEqualTo(1);
    }
}
