First version with ability to create database for new season

This commit is contained in:
2020-09-27 19:05:20 +02:00
parent b97e15be7d
commit 283efc775b
75 changed files with 106536 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
package de.jeyp91.googlecalendar;
import com.google.api.client.util.DateTime;
import com.google.api.services.calendar.model.Event;
import de.jeyp91.tippliga.TLWMatchday;
import org.junit.Test;
import java.util.List;
import static org.junit.Assert.assertEquals;
public class GoogleCalendarConnectorTest {
@Test
public void getAllEventsStartingFromDateTimeTest()
{
DateTime dateTime = new DateTime("2020-01-01T00:00:00");
List<Event> events = GoogleCalendarConnector.getAllEventsStartingFromDateTime(1, dateTime);
assertEquals("Tippliga 20. Spieltag tippen!", events.get(0).getSummary());
DateTime startExpected = new DateTime("2020-01-17T20:30:00+01:00");
DateTime startActual = events.get(0).getStart().getDateTime();
assertEquals(startExpected, startActual);
assertEquals("Tippliga 21. Spieltag tippen!", events.get(1).getSummary());
startExpected = new DateTime("2020-01-24T20:30:00+01:00");
startActual = events.get(1).getStart().getDateTime();
assertEquals(startExpected, startActual);
}
@Test
public void createEventTest() {
TLWMatchday matchday = new TLWMatchday(2020, 1, 1, 0, "2020-07-01 20:30:00", "", "", "", 1);
GoogleCalendarConnector.createNewEvent(matchday);
}
}