mirror of https://github.com/FreeCol/freecol.git
added new disaster test cases
This commit is contained in:
parent
259ac136a5
commit
8cc717b383
16
freecol.iml
16
freecol.iml
|
@ -4,23 +4,9 @@
|
|||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/jars" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/test/lib" type="java-test-resource" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module-library" scope="TEST">
|
||||
<library name="JUnit4">
|
||||
<CLASSES>
|
||||
<root url="jar://$APPLICATION_HOME_DIR$/lib/junit-4.12.jar!/" />
|
||||
<root url="jar://$APPLICATION_HOME_DIR$/lib/hamcrest-core-1.3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="library" name="miglayout-core-4.2" level="application" />
|
||||
<orderEntry type="library" name="commons-cli-1.3.1" level="project" />
|
||||
<orderEntry type="library" name="jars" level="project" />
|
||||
</component>
|
||||
</module>
|
|
@ -47,8 +47,25 @@ public class DisasterTest extends FreeColTestCase {
|
|||
assertEquals(choice.getProbability(), choice.getObject().getProbability());
|
||||
}
|
||||
|
||||
disaster = spec().getDisaster("model.disaster.disease");
|
||||
assertNotNull(disaster);
|
||||
assertFalse(disaster.getEffects().isEmpty());
|
||||
for (RandomChoice<Effect> choice : disaster.getEffects()) {
|
||||
assertNotNull(choice.getObject().getId());
|
||||
assertTrue(choice.getProbability() > 0);
|
||||
assertTrue(choice.getObject().getProbability() > 0);
|
||||
assertEquals(choice.getProbability(), choice.getObject().getProbability());
|
||||
}
|
||||
|
||||
disaster = spec().getDisaster("model.disaster.sandstorm");
|
||||
assertNotNull(disaster);
|
||||
assertFalse(disaster.getEffects().isEmpty());
|
||||
for (RandomChoice<Effect> choice : disaster.getEffects()) {
|
||||
assertNotNull(choice.getObject().getId());
|
||||
assertTrue(choice.getProbability() > 0);
|
||||
assertTrue(choice.getObject().getProbability() > 0);
|
||||
assertEquals(choice.getProbability(), choice.getObject().getProbability());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue