package de.jeyp91.tippliga;

import org.junit.Test;

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

import static org.junit.Assert.assertEquals;

public class TLWMatchdaysCreatorTest {

    @Test
    public void getMatchdaysTippligaTest() throws ParseException {

        TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(2021, 1, "Tippliga.json");
        ArrayList<TLWMatchday> matchdays = matchdaysCreator.getMatchdays();

        assertEquals((Integer) 1, matchdays.get(0).getMatchday());
    }

    @Test
    public void getMatchdaysWTLPokalTest() throws ParseException {
        TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(2021, 1, "WTL_Pokal.json");
        ArrayList<TLWMatchday> matchdays = matchdaysCreator.getMatchdays();

        assertEquals((Integer) 1, matchdays.get(0).getMatchday());
    }

    @Test
    public void getMatchdaysTippliga1SqlTest() throws ParseException {

        TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(2021, 1, "Tippliga.json");
        String sql = matchdaysCreator.getMatchdaysSQL();
        System.out.println(sql);
    }

    @Test
    public void getMatchdaysTippliga2SqlTest() throws ParseException {

        TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(2021, 2, "Tippliga.json");
        String sql = matchdaysCreator.getMatchdaysSQL();
        System.out.println(sql);
    }

    @Test
    public void getMatchdaysTippliga51SqlTest() throws ParseException {

        TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(2021, 51, "Tippliga.json");
        String sql = matchdaysCreator.getMatchdaysSQL();
        System.out.println(sql);
    }

    @Test
    public void getMatchdaysTippliga52SqlTest() throws ParseException {

        TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(2021, 52, "Tippliga.json");
        String sql = matchdaysCreator.getMatchdaysSQL();
        System.out.println(sql);
    }

    @Test
    public void getMatchdaysWTLPokal48SqlTest() throws ParseException {

        TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(2021, 48, "WTL_Pokal.json");
        String sql = matchdaysCreator.getMatchdaysSQL();
        System.out.println(sql);
    }

    @Test
    public void getMatchdaysWTLPokal98SqlTest() throws ParseException {

        TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(2021, 98, "WTL_Pokal.json");
        String sql = matchdaysCreator.getMatchdaysSQL();
        System.out.println(sql);
    }
}
