Tests now work again, yay

This commit is contained in:
Yair Morgenstern 2019-12-05 18:44:07 +02:00
parent 0a3d3bf3f7
commit 1903709f20
2 changed files with 9 additions and 9 deletions

View File

@ -26,7 +26,7 @@ public class BasicTests {
@Test
public void gameBasicsLoad() {
assertTrue("This test will only pass when the jsons can be loaded",
RuleSet.INSTANCE.getBuildings().size() > 0);
new RuleSet().getBuildings().size() > 0);
}

View File

@ -21,26 +21,26 @@ public class TranslationTests {
@Test
public void translationsLoad() {
assertTrue("This test will only pass there are translations",
RuleSet.INSTANCE.getTranslations().size() > 0);
new RuleSet().getTranslations().size() > 0);
}
@Test
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",
allUnitsHaveTranslation);
}
@Test
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",
allBuildingsHaveTranslation);
}
@Test
public void allTerrainsHaveTranslation() {
Set<String> strings = RuleSet.INSTANCE.getTerrains().keySet();
Set<String> strings = new RuleSet().getTerrains().keySet();
Boolean allStringsHaveTranslation = allStringAreTranslated(strings);
assertTrue("This test will only pass when there is a translation for all buildings",
allStringsHaveTranslation);
@ -48,7 +48,7 @@ public class TranslationTests {
@Test
public void allImprovementsHaveTranslation() {
Set<String> strings = RuleSet.INSTANCE.getTileImprovements().keySet();
Set<String> strings = new RuleSet().getTileImprovements().keySet();
Boolean allStringsHaveTranslation = allStringAreTranslated(strings);
assertTrue("This test will only pass when there is a translation for all improvements",
allStringsHaveTranslation);
@ -56,7 +56,7 @@ public class TranslationTests {
@Test
public void allTechnologiesHaveTranslation() {
Set<String> strings = RuleSet.INSTANCE.getTechnologies().keySet();
Set<String> strings = new RuleSet().getTechnologies().keySet();
Boolean allStringsHaveTranslation = allStringAreTranslated(strings);
assertTrue("This test will only pass when there is a translation for all technologies",
allStringsHaveTranslation);
@ -64,7 +64,7 @@ public class TranslationTests {
@Test
public void allPromotionsHaveTranslation() {
Set<String> strings = RuleSet.INSTANCE.getUnitPromotions().keySet();
Set<String> strings = new RuleSet().getUnitPromotions().keySet();
Boolean allStringsHaveTranslation = allStringAreTranslated(strings);
assertTrue("This test will only pass when there is a translation for all promotions",
allStringsHaveTranslation);
@ -73,7 +73,7 @@ public class TranslationTests {
private Boolean allStringAreTranslated(Set<String> strings) {
boolean allBuildingsHaveTranslation = true;
for (String unitName : strings) {
if (!RuleSet.INSTANCE.getTranslations().containsKey(unitName)) {
if (!new RuleSet().getTranslations().containsKey(unitName)) {
allBuildingsHaveTranslation = false;
System.out.println(unitName);
}