package de.jeyp91.tippliga;

import org.junit.Test;

import java.text.ParseException;
import java.util.ArrayList;

import static org.junit.Assert.assertEquals;

public class TLWTeamsCreatorTest {
    @Test
    public void getTeamsTippligaFootball1Test() {
        TLWMatchesCreatorFootball matchesCreator = new TLWMatchesCreatorFootball(2021, 1, "Tippliga.json");
        ArrayList<TLWMatch> matches = matchesCreator.getMatches();

        TLWTeamsCreator teamCreator = new TLWTeamsCreator(2021, 1, matches);
        String sql = teamCreator.getSql();
        System.out.println(sql);
    }

    @Test
    public void getTeamsTipper1TLTest() throws ParseException {
        TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(2021, 1, "Tippliga.json");

        TLWMatchesCreatorTipperLeague creator = new TLWMatchesCreatorTipperLeague(2021, 51, "1TL_Tipper.json", matchdaysCreator.getMatchdays());

        ArrayList<TLWMatch> matches = creator.getMatches();

        TLWTeamsCreator teamCreator = new TLWTeamsCreator(2021, 51, matches);
        String sql = teamCreator.getSql();
        System.out.println(sql);
    }

    @Test
    public void getTeamsTipper2TLTest() throws ParseException {
        TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(2021, 2, "Tippliga.json");

        TLWMatchesCreatorTipperLeague creator = new TLWMatchesCreatorTipperLeague(2021, 52, "2TL_Tipper.json", matchdaysCreator.getMatchdays());

        ArrayList<TLWMatch> matches = creator.getMatches();

        TLWTeamsCreator teamCreator = new TLWTeamsCreator(2021, 52, matches);
        String sql = teamCreator.getSql();
        System.out.println(sql);
    }

    @Test
    public void getTeamsTipperWTLTest() throws ParseException {
        TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(2021, 48, "WTL_Pokal.json");

        TLWMatchesCreatorTipperPokal creator = new TLWMatchesCreatorTipperPokal(2021, 98, "WTL_Tipper.json", matchdaysCreator.getMatchdays());

        ArrayList<TLWMatch> matches = creator.getMatches();

        TLWTeamsCreator teamCreator = new TLWTeamsCreator(2021, 98, matches);
        String sql = teamCreator.getSql();
        System.out.println(sql);
    }
}
