Skip to content

Commit

Permalink
Fixed the tests to use the correct generator
Browse files Browse the repository at this point in the history
  • Loading branch information
UO289845 committed Apr 7, 2024
1 parent 5bb4ceb commit 904d0dd
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import main.java.questionGenerator.QuestionGeneratorMock;
import main.java.questionGenerator.QuestionGenerator;
import main.java.questionGenerator.question.QuestionType;

public class QuestionGeneratorTests {

private QuestionGeneratorMock qgEN;
private QuestionGeneratorMock qgES;
private QuestionGenerator qgEN;
private QuestionGenerator qgES;

private static QuestionType[] types = {QuestionType.POPULATION, QuestionType.CAPITAL, QuestionType.SIZE, QuestionType.LANGUAGE};

@BeforeEach
void setUp(){
qgEN = new QuestionGeneratorMock("en");
qgES = new QuestionGeneratorMock("es");
qgEN = new QuestionGenerator("en");
qgES = new QuestionGenerator("es");
}

@Test
Expand All @@ -39,7 +39,7 @@ void testGenerateQuestionsEnglish() {

for(QuestionType t : types) {
for(int i=0; i<3; i++) {
question = qgEN.generateQuestion(t).getJSON().toString();
question = qgEN.generateQuestions(t, 1).get(0).getJSON().toString();
JSONObject json = null;

//Check correct format
Expand Down Expand Up @@ -98,7 +98,7 @@ void testGenerateQuestionsSpanish() {

for(QuestionType t : types) {
for(int i=0; i<3; i++) {
question = qgES.generateQuestion(t).getJSON().toString();
question = qgES.generateQuestions(t, 1).get(0).getJSON().toString();
JSONObject json = null;

//Check correct format
Expand Down

0 comments on commit 904d0dd

Please sign in to comment.