mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-06 08:21:36 +07:00
Fixed crash in tile editor as a result of adding Fallout, which has no "occursOn" terrains
This commit is contained in:
@ -1,30 +0,0 @@
|
||||
// Taken from https://github.com/TomGrill/gdx-testing
|
||||
|
||||
package de.tomgrill.gdxtesting.examples;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.unciv.models.gamebasics.GameBasics;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import de.tomgrill.gdxtesting.GdxTestRunner;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
@RunWith(GdxTestRunner.class)
|
||||
public class AssetExistsExampleTest {
|
||||
|
||||
@Test
|
||||
public void gamePngExists() {
|
||||
assertTrue("This test will only pass when the game.png exists",
|
||||
Gdx.files.local("game.png").exists());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void gameBasicsLoad() {
|
||||
assertTrue("This test will only pass when the game.png exists",
|
||||
GameBasics.INSTANCE.getBuildings().size() > 0);
|
||||
}
|
||||
|
||||
}
|
36
tests/src/de/tomgrill/gdxtesting/examples/BasicTests.kt
Normal file
36
tests/src/de/tomgrill/gdxtesting/examples/BasicTests.kt
Normal file
@ -0,0 +1,36 @@
|
||||
// Taken from https://github.com/TomGrill/gdx-testing
|
||||
|
||||
package de.tomgrill.gdxtesting.examples
|
||||
|
||||
import com.badlogic.gdx.Gdx
|
||||
import com.unciv.UnCivGame
|
||||
import com.unciv.models.gamebasics.GameBasics
|
||||
import com.unciv.ui.mapeditor.MapEditorScreen
|
||||
import de.tomgrill.gdxtesting.GdxTestRunner
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
@RunWith(GdxTestRunner::class)
|
||||
class BasicTests {
|
||||
|
||||
@Test
|
||||
fun gamePngExists() {
|
||||
assertTrue("This test will only pass when the game.png exists",
|
||||
Gdx.files.local("game.png").exists())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun gameBasicsLoad() {
|
||||
assertTrue("This test will only pass when the GameBasics can initialize, and there are buildings",
|
||||
GameBasics.Buildings.size > 0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun canOpenMapEditorScreen() {
|
||||
UnCivGame.Current.setScreen(MapEditorScreen(UnCivGame.Current.gameInfo.tileMap))
|
||||
assertTrue("This test will only pass when we can open the map editor screen",
|
||||
GameBasics.Buildings.size > 0)
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user