test created

This commit is contained in:
Joshua Perry 2023-02-05 19:25:43 +00:00
parent df775ed93c
commit 7df4780fec
2 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,32 @@
package com.r0r5chach;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.File;
import org.junit.jupiter.api.Test;
import com.r0r5chach.controllers.Controller;
public class ControllerTest {
@Test
public void controllerSetCompetitorsTest() {
Controller c = new Controller();
CompetitorList cL = null;
try {
cL = new CompetitorList();
cL.readCompetitors(new File("src/test/resources/valorantPlayers.txt"));
}
catch (Exception e) {
}
c.setCompetitors(cL);
assertEquals(101, c.getCompetitors().getCompetitors().get(0).getPlayerNumber());
}
@Test
public void controllerGetCompetitorsTest() {
//Already tested in controllerSetCompetitorsTest()
}
}

View File

@ -1,4 +1,5 @@
package com.r0r5chach;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;