Tests for classes ScheduleFormat and NetworkFormat complete.

This commit is contained in:
MAMBILA TETE jean philipp 2024-03-18 16:41:29 +01:00
parent 6048d843b4
commit 1c291b3142

View file

@ -0,0 +1,33 @@
package fr.u_paris.gla.project.io;
import org.junit.jupiter.api.Test;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import java.util.List;
import static org.junit.jupiter.api.Assertions.*;
class ScheduleFormatTest {
@Test
void getTripSequence() {
String rpz = "4, 5, 19, 21";
List<Integer> test = Arrays.asList(4, 5, 19, 21);
assertEquals(test, ScheduleFormat.getTripSequence(rpz));
}
@Test
void getTimeFormatter() {
DateTimeFormatter formatter = ScheduleFormat.getTimeFormatter();
LocalDateTime date = LocalDateTime.now();
String test = date.format(formatter);
//format date: YYYY-MM-DDTHH:MM:SS.DECIMAL
assertEquals(date.toString().substring(11, 16), test);
}
}