Tests for classes ScheduleFormat and NetworkFormat complete.
This commit is contained in:
parent
6048d843b4
commit
1c291b3142
1 changed files with 33 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
||||
}
|
||||
}
|
Reference in a new issue