package org.studiorailgun;

import static org.junit.jupiter.api.Assertions.*;

import org.junit.jupiter.api.Test;
import org.studiorailgun.conversation.ConvAI;
import org.studiorailgun.conversation.evaluators.query.QueryData;
import org.studiorailgun.conversation.evaluators.query.QueryEval;
import org.studiorailgun.conversation.tracking.Quote;

/**
 * Query tests
 */
public class QueryTests {
    
    @Test
    public void testOtherGreeting(){
        Globals.init("./data/webs/test/web.json");
        
        Quote response = ConvAI.simFrame("What color is your hat?");

        boolean responseContainsBlue = response.getRaw().contains("Blue");
        assertEquals(responseContainsBlue, true);
    }


    @Test
    public void testQueryEval(){
        Globals.init("./data/webs/test/web.json");
        QueryEval.evaluate(Globals.conversation, new Quote("What color is your hat?"));
        QueryData queryData = Globals.conversation.getGoalData().getQueryData();
        assertEquals(queryData.getRecentQueries().size(), 1);
    }

}
