mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 13:55:54 -04:00
Tests now work again, yay
This commit is contained in:
parent
0a3d3bf3f7
commit
1903709f20
@ -26,7 +26,7 @@ public class BasicTests {
|
|||||||
@Test
|
@Test
|
||||||
public void gameBasicsLoad() {
|
public void gameBasicsLoad() {
|
||||||
assertTrue("This test will only pass when the jsons can be loaded",
|
assertTrue("This test will only pass when the jsons can be loaded",
|
||||||
RuleSet.INSTANCE.getBuildings().size() > 0);
|
new RuleSet().getBuildings().size() > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,26 +21,26 @@ public class TranslationTests {
|
|||||||
@Test
|
@Test
|
||||||
public void translationsLoad() {
|
public void translationsLoad() {
|
||||||
assertTrue("This test will only pass there are translations",
|
assertTrue("This test will only pass there are translations",
|
||||||
RuleSet.INSTANCE.getTranslations().size() > 0);
|
new RuleSet().getTranslations().size() > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void allUnitsHaveTranslation() {
|
public void allUnitsHaveTranslation() {
|
||||||
Boolean allUnitsHaveTranslation = allStringAreTranslated(RuleSet.INSTANCE.getUnits().keySet());
|
Boolean allUnitsHaveTranslation = allStringAreTranslated(new RuleSet().getUnits().keySet());
|
||||||
assertTrue("This test will only pass when there is a translation for all units",
|
assertTrue("This test will only pass when there is a translation for all units",
|
||||||
allUnitsHaveTranslation);
|
allUnitsHaveTranslation);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void allBuildingsHaveTranslation() {
|
public void allBuildingsHaveTranslation() {
|
||||||
Boolean allBuildingsHaveTranslation = allStringAreTranslated(RuleSet.INSTANCE.getBuildings().keySet());
|
Boolean allBuildingsHaveTranslation = allStringAreTranslated(new RuleSet().getBuildings().keySet());
|
||||||
assertTrue("This test will only pass when there is a translation for all buildings",
|
assertTrue("This test will only pass when there is a translation for all buildings",
|
||||||
allBuildingsHaveTranslation);
|
allBuildingsHaveTranslation);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void allTerrainsHaveTranslation() {
|
public void allTerrainsHaveTranslation() {
|
||||||
Set<String> strings = RuleSet.INSTANCE.getTerrains().keySet();
|
Set<String> strings = new RuleSet().getTerrains().keySet();
|
||||||
Boolean allStringsHaveTranslation = allStringAreTranslated(strings);
|
Boolean allStringsHaveTranslation = allStringAreTranslated(strings);
|
||||||
assertTrue("This test will only pass when there is a translation for all buildings",
|
assertTrue("This test will only pass when there is a translation for all buildings",
|
||||||
allStringsHaveTranslation);
|
allStringsHaveTranslation);
|
||||||
@ -48,7 +48,7 @@ public class TranslationTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void allImprovementsHaveTranslation() {
|
public void allImprovementsHaveTranslation() {
|
||||||
Set<String> strings = RuleSet.INSTANCE.getTileImprovements().keySet();
|
Set<String> strings = new RuleSet().getTileImprovements().keySet();
|
||||||
Boolean allStringsHaveTranslation = allStringAreTranslated(strings);
|
Boolean allStringsHaveTranslation = allStringAreTranslated(strings);
|
||||||
assertTrue("This test will only pass when there is a translation for all improvements",
|
assertTrue("This test will only pass when there is a translation for all improvements",
|
||||||
allStringsHaveTranslation);
|
allStringsHaveTranslation);
|
||||||
@ -56,7 +56,7 @@ public class TranslationTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void allTechnologiesHaveTranslation() {
|
public void allTechnologiesHaveTranslation() {
|
||||||
Set<String> strings = RuleSet.INSTANCE.getTechnologies().keySet();
|
Set<String> strings = new RuleSet().getTechnologies().keySet();
|
||||||
Boolean allStringsHaveTranslation = allStringAreTranslated(strings);
|
Boolean allStringsHaveTranslation = allStringAreTranslated(strings);
|
||||||
assertTrue("This test will only pass when there is a translation for all technologies",
|
assertTrue("This test will only pass when there is a translation for all technologies",
|
||||||
allStringsHaveTranslation);
|
allStringsHaveTranslation);
|
||||||
@ -64,7 +64,7 @@ public class TranslationTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void allPromotionsHaveTranslation() {
|
public void allPromotionsHaveTranslation() {
|
||||||
Set<String> strings = RuleSet.INSTANCE.getUnitPromotions().keySet();
|
Set<String> strings = new RuleSet().getUnitPromotions().keySet();
|
||||||
Boolean allStringsHaveTranslation = allStringAreTranslated(strings);
|
Boolean allStringsHaveTranslation = allStringAreTranslated(strings);
|
||||||
assertTrue("This test will only pass when there is a translation for all promotions",
|
assertTrue("This test will only pass when there is a translation for all promotions",
|
||||||
allStringsHaveTranslation);
|
allStringsHaveTranslation);
|
||||||
@ -73,7 +73,7 @@ public class TranslationTests {
|
|||||||
private Boolean allStringAreTranslated(Set<String> strings) {
|
private Boolean allStringAreTranslated(Set<String> strings) {
|
||||||
boolean allBuildingsHaveTranslation = true;
|
boolean allBuildingsHaveTranslation = true;
|
||||||
for (String unitName : strings) {
|
for (String unitName : strings) {
|
||||||
if (!RuleSet.INSTANCE.getTranslations().containsKey(unitName)) {
|
if (!new RuleSet().getTranslations().containsKey(unitName)) {
|
||||||
allBuildingsHaveTranslation = false;
|
allBuildingsHaveTranslation = false;
|
||||||
System.out.println(unitName);
|
System.out.println(unitName);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user