package tourplaner.tests;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import tourplaner.object.Log;

import java.time.LocalDate;

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


class LogTest {

    private Log log;
    private final LocalDate date = LocalDate.now();

    @BeforeEach
    void setUp() {
        this.log = new Log("1", 2, this.date, 3, "4", 5, 6, "7");
    }

    @Test
    void getRating() {
        assertEquals(this.log.getRating(), "7");
    }

    @Test
    void getBemerkung() {
        assertEquals(this.log.getBemerkung(), "4");
    }

    @Test
    void getAvgspeed() {
        double act = -45;
        assertEquals(this.log.getAvgspeed(), act);
    }


    @Test
    void getHightmeter() {
        assertEquals(this.log.getHightmeter(), 5);
    }

    @Test
    void getPause() {
        assertEquals(this.log.getPause(), 6);
    }

    @Test
    void getGegangen() {
        assertEquals(this.log.getGegangen(), 2-6);
    }

    @Test
    void getId() {
        assertEquals(this.log.getId(), "1");
    }

    @Test
    void getDauer() {
        assertEquals(this.log.getDauer(), 2);
    }

    @Test
    void getDatum() {
        assertEquals(this.log.getDatum(), this.date);
    }

    @Test
    void getStrecke() {
        assertEquals(this.log.getStrecke(), 3);
    }
}
