updated
This commit is contained in:
parent
b092be40c3
commit
009a23ebc0
|
|
@ -9,6 +9,9 @@ import java.nio.file.Path;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Scanner;
|
||||
|
||||
import org.r0r5chach.valorant.ValorantAgent;
|
||||
import org.r0r5chach.valorant.ValorantPlayer;
|
||||
|
||||
public class CompetitorList {
|
||||
private final ArrayList<ValorantPlayer> competitors;
|
||||
|
||||
|
|
@ -43,7 +46,7 @@ public class CompetitorList {
|
|||
private ValorantPlayer parseRow(String[] row) {
|
||||
int playerNumber = Integer.parseInt(row[0]);
|
||||
Name playerName = new Name(row[1]);
|
||||
ValorantRank playerLevel = ValorantRank.valueOf(row[2]);
|
||||
Rank playerLevel = Rank.valueOf(row[2]);
|
||||
ValorantAgent favoriteAgent = ValorantAgent.valueOf(row[3]);
|
||||
int[] scores = parseScores(row[4]);
|
||||
return new ValorantPlayer(playerNumber, playerName, playerLevel, favoriteAgent, scores);
|
||||
|
|
@ -184,7 +187,7 @@ public class CompetitorList {
|
|||
|
||||
int[] freqs = generateLevelFreqs();
|
||||
for (int i = 0; i < freqs.length; i++) {
|
||||
replaceVar( "%LEVEL"+i+"%", ValorantRank.values()[i].getRank());
|
||||
replaceVar( "%LEVEL"+i+"%", Rank.values()[i].getRank());
|
||||
replaceVar( "%VALUE"+i+"%", String.valueOf(freqs[i]));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.r0r5chach.ValorantRank;
|
||||
import org.r0r5chach.Rank;
|
||||
|
||||
|
||||
public class ValorantRankTest {
|
||||
public class RankTest {
|
||||
@Test
|
||||
public void valorantRankTestGetRank() {
|
||||
ValorantRank vR = ValorantRank.IRON;
|
||||
assertEquals("Iron", vR.getRank());
|
||||
Rank vR = Rank.BRONZE;
|
||||
assertEquals("Bronze", vR.getRank());
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.r0r5chach.ValorantAgent;
|
||||
import org.r0r5chach.valorant.ValorantAgent;
|
||||
|
||||
public class ValorantAgentTest {
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -1,25 +1,25 @@
|
|||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.r0r5chach.Name;
|
||||
import org.r0r5chach.ValorantAgent;
|
||||
import org.r0r5chach.ValorantPlayer;
|
||||
import org.r0r5chach.ValorantRank;
|
||||
import org.r0r5chach.Rank;
|
||||
import org.r0r5chach.valorant.ValorantAgent;
|
||||
import org.r0r5chach.valorant.ValorantPlayer;
|
||||
public class ValorantPlayerTest {
|
||||
@Test
|
||||
public void valorantPlayerTest() {
|
||||
int[] scores = {5,5,5,5,5,5};
|
||||
ValorantPlayer vP = new ValorantPlayer(2,new Name("Joshua Luke Perry"), ValorantRank.GOLD, ValorantAgent.FADE, scores);
|
||||
ValorantPlayer vP = new ValorantPlayer(2,new Name("Joshua Luke Perry"), Rank.GOLD, ValorantAgent.FADE, scores);
|
||||
assertEquals(2, vP.getPlayerNumber());
|
||||
assertEquals("Joshua Luke Perry", vP.getPlayerName().getFullName());
|
||||
assertEquals("Gold", vP.getPlayerLevel().getRank());
|
||||
assertEquals("Fade", vP.getFavouriteAgent().getAgent());
|
||||
assertEquals("Fade", vP.getFavoriteAgent().getAgent());
|
||||
assertEquals(5, vP.getOverallScore());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void valorantPlayerTestSetPlayerNumber() {
|
||||
int[] scores = {5,5,5,5,5,5};
|
||||
ValorantPlayer vP = new ValorantPlayer(2,new Name("Joshua Luke Perry"), ValorantRank.GOLD, ValorantAgent.FADE, scores);
|
||||
ValorantPlayer vP = new ValorantPlayer(2,new Name("Joshua Luke Perry"), Rank.GOLD, ValorantAgent.FADE, scores);
|
||||
|
||||
vP.setPlayerNumber(5);
|
||||
assertEquals(5, vP.getPlayerNumber());
|
||||
|
|
@ -28,7 +28,7 @@ public class ValorantPlayerTest {
|
|||
@Test
|
||||
public void valorantPlayerTestSetPlayerName() {
|
||||
int[] scores = {5,5,5,5,5,5};
|
||||
ValorantPlayer vP = new ValorantPlayer(2,new Name("Joshua Luke Perry"), ValorantRank.GOLD, ValorantAgent.FADE, scores);
|
||||
ValorantPlayer vP = new ValorantPlayer(2,new Name("Joshua Luke Perry"), Rank.GOLD, ValorantAgent.FADE, scores);
|
||||
|
||||
vP.setPlayerName(new Name("Bradley Gordon-Taylor"));
|
||||
assertEquals("Bradley Gordon-Taylor", vP.getPlayerName().getFullName());
|
||||
|
|
@ -37,25 +37,25 @@ public class ValorantPlayerTest {
|
|||
@Test
|
||||
public void valorantPlayerTestSetPlayerLevel() {
|
||||
int[] scores = {5,5,5,5,5,5};
|
||||
ValorantPlayer vP = new ValorantPlayer(2,new Name("Joshua Luke Perry"), ValorantRank.GOLD, ValorantAgent.FADE, scores);
|
||||
ValorantPlayer vP = new ValorantPlayer(2,new Name("Joshua Luke Perry"), Rank.GOLD, ValorantAgent.FADE, scores);
|
||||
|
||||
vP.setPlayerLevel(ValorantRank.BRONZE);
|
||||
vP.setPlayerLevel(Rank.BRONZE);
|
||||
assertEquals("Bronze", vP.getPlayerLevel().getRank());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void valorantPlayerTestSetFavouriteAgent() {
|
||||
public void valorantPlayerTestSetFavoriteAgent() {
|
||||
int[] scores = {5,5,5,5,5,5};
|
||||
ValorantPlayer vP = new ValorantPlayer(2,new Name("Joshua Luke Perry"), ValorantRank.GOLD, ValorantAgent.FADE, scores);
|
||||
ValorantPlayer vP = new ValorantPlayer(2,new Name("Joshua Luke Perry"), Rank.GOLD, ValorantAgent.FADE, scores);
|
||||
|
||||
vP.setFavouriteAgent(ValorantAgent.VIPER);
|
||||
assertEquals("Viper", vP.getFavouriteAgent().getAgent());
|
||||
vP.setFavoriteAgent(ValorantAgent.VIPER);
|
||||
assertEquals("Viper", vP.getFavoriteAgent().getAgent());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void valorantPlayerTestSetScores() {
|
||||
int[] scores = {5,5,5,5,5,5};
|
||||
ValorantPlayer vP = new ValorantPlayer(2,new Name("Joshua Luke Perry"), ValorantRank.GOLD, ValorantAgent.FADE, scores);
|
||||
ValorantPlayer vP = new ValorantPlayer(2,new Name("Joshua Luke Perry"), Rank.GOLD, ValorantAgent.FADE, scores);
|
||||
|
||||
vP.setScores(new int[]{0, 0, 0, 0, 0, 0});
|
||||
assertEquals(0, vP.getOverallScore());
|
||||
|
|
@ -64,20 +64,20 @@ public class ValorantPlayerTest {
|
|||
@Test
|
||||
public void valorantPlayerTestGetOverallScore() {
|
||||
int[] scores = {5,5,5,5,5,5};
|
||||
ValorantPlayer vP = new ValorantPlayer(2,new Name("Joshua Luke Perry"), ValorantRank.GOLD, ValorantAgent.FADE, scores);
|
||||
ValorantPlayer vP = new ValorantPlayer(2,new Name("Joshua Luke Perry"), Rank.GOLD, ValorantAgent.FADE, scores);
|
||||
assertEquals(5, vP.getOverallScore());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void valorantPlayerTestGetFullDetails() {
|
||||
int[] scores = {5,5,5,5,5,5};
|
||||
ValorantPlayer vP = new ValorantPlayer(2,new Name("Joshua Luke Perry"), ValorantRank.GOLD, ValorantAgent.FADE, scores);
|
||||
ValorantPlayer vP = new ValorantPlayer(2,new Name("Joshua Luke Perry"), Rank.GOLD, ValorantAgent.FADE, scores);
|
||||
|
||||
assertEquals("""
|
||||
Player Number: 2
|
||||
Name: Joshua Luke Perry
|
||||
Player Level: Gold
|
||||
Favourite Agent: Fade
|
||||
Favorite Agent: Fade
|
||||
Scores: 5, 5, 5, 5, 5, 5
|
||||
Overall Score: 5.0""", vP.getFullDetails());
|
||||
}
|
||||
|
|
@ -85,7 +85,7 @@ public class ValorantPlayerTest {
|
|||
@Test
|
||||
public void valorantPlayerTestGetShortDetails() {
|
||||
int[] scores = {5,5,5,5,5,5};
|
||||
ValorantPlayer vP = new ValorantPlayer(2,new Name("Joshua Luke Perry"), ValorantRank.GOLD, ValorantAgent.FADE, scores);
|
||||
ValorantPlayer vP = new ValorantPlayer(2,new Name("Joshua Luke Perry"), Rank.GOLD, ValorantAgent.FADE, scores);
|
||||
|
||||
assertEquals("CN 2 (JLP) has overall score 5.0", vP.getShortDetails());
|
||||
}
|
||||
|
|
@ -107,7 +107,7 @@ public class ValorantPlayerTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void valorantPlayerTestGetFavouriteAgent() {
|
||||
public void valorantPlayerTestGetFavoriteAgent() {
|
||||
//Already tested in valorantPlayerTest()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue