package ch.epfl.isochrone.timetable;

import static org.junit.Assert.assertTrue;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

import org.junit.Ignore;
import org.junit.Test;

import ch.epfl.isochrone.geo.PointWGS84;
import ch.epfl.isochrone.timetable.Date.DayOfWeek;
import ch.epfl.isochrone.timetable.Date.Month;

public class TestTimeTable {
    // Le "test" suivant n'en est pas un à proprement parler, raison pour
    // laquelle il est ignoré (annotation @Ignore). Son seul but est de garantir
    // que les noms des classes et méthodes sont corrects.
    @Test
    @Ignore
    public void namesAreOk() {
        TimeTable t = new TimeTable(Collections.<Stop> emptySet(),
                Collections.<Service> emptySet());
        t.stops();
        t.servicesForDate(new Date(1, Month.JANUARY, 2000));

        TimeTable.Builder b = new TimeTable.Builder();
        b.addStop(new Stop("s", new PointWGS84(0, 0)));
        Date d = new Date(1, Month.APRIL, 2000);
        b.addService(new Service("s", d, d, Collections.<DayOfWeek> emptySet(),
                Collections.<Date> emptySet(), Collections.<Date> emptySet()));
        b.build();
    }

    @Test
    public void immu() {
        Date d = new Date(1, Month.APRIL, 2000);

        Stop s = new Stop("bonjour", new PointWGS84(1.0, 1.0));
        Service serv = new Service("s", d, d,
                Collections.<DayOfWeek> emptySet(),
                Collections.<Date> emptySet(), Collections.<Date> emptySet());
        Set<Stop> Stops = new HashSet<Stop>();
        Set<Service> Services = new HashSet<Service>();

        Stops.add(s);
        Services.add(serv);

        TimeTable t = new TimeTable(Stops, Services);

        Stops.clear();
        Services.clear();

        assertTrue(!t.stops().isEmpty());
        assertTrue(!t.servicesForDate(d).isEmpty());
        System.out.println("bonjour");

    }

}
