mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-24 18:06:04 +07:00
Fixed tests that I broke when changing ruleset logic
This commit is contained in:
parent
285c92150c
commit
c322a5da30
@ -4,13 +4,23 @@ package com.unciv.testing
|
||||
import com.badlogic.gdx.Gdx
|
||||
import com.unciv.UncivGame
|
||||
import com.unciv.models.ruleset.Ruleset
|
||||
import com.unciv.models.ruleset.RulesetCache
|
||||
import com.unciv.models.ruleset.unit.BaseUnit
|
||||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
@RunWith(GdxTestRunner::class)
|
||||
class BasicTests {
|
||||
|
||||
var ruleset = Ruleset()
|
||||
@Before
|
||||
fun loadTranslations() {
|
||||
RulesetCache.loadRulesets()
|
||||
ruleset = RulesetCache.getBaseRuleset()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun gamePngExists() {
|
||||
Assert.assertTrue("This test will only pass when the game.png exists",
|
||||
@ -20,7 +30,7 @@ class BasicTests {
|
||||
@Test
|
||||
fun loadRuleset() {
|
||||
Assert.assertTrue("This test will only pass when the jsons can be loaded",
|
||||
Ruleset(true).buildings.size > 0)
|
||||
ruleset.buildings.size > 0)
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -34,7 +44,7 @@ class BasicTests {
|
||||
// and we try to work on its upgrade, we'll get an exception - see techManager
|
||||
@Test
|
||||
fun allObsoletingUnitsHaveUpgrades() {
|
||||
val units: Collection<BaseUnit> = Ruleset(true).units.values
|
||||
val units: Collection<BaseUnit> = ruleset.units.values
|
||||
var allObsoletingUnitsHaveUpgrades = true
|
||||
for (unit in units) {
|
||||
if (unit.obsoleteTech != null && unit.upgradesTo == null) {
|
||||
|
@ -6,22 +6,25 @@ import com.badlogic.gdx.utils.Array
|
||||
import com.unciv.JsonParser
|
||||
import com.unciv.models.ruleset.Nation
|
||||
import com.unciv.models.ruleset.Ruleset
|
||||
import com.unciv.models.ruleset.RulesetCache
|
||||
import com.unciv.models.translations.Translations
|
||||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import java.util.HashSet
|
||||
import java.util.*
|
||||
|
||||
@RunWith(GdxTestRunner::class)
|
||||
class TranslationTests {
|
||||
private var translations = Translations()
|
||||
private var ruleSet = Ruleset(true)
|
||||
private var ruleSet = Ruleset()
|
||||
private val jsonParser = JsonParser()
|
||||
|
||||
@Before
|
||||
fun loadTranslations() {
|
||||
translations.readAllLanguagesTranslation()
|
||||
RulesetCache.loadRulesets()
|
||||
ruleSet = RulesetCache.getBaseRuleset()
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
Reference in New Issue
Block a user