forked from External/mage
Refactored card cache;
This commit is contained in:
parent
96daa4e0a9
commit
5fa99262bf
4 changed files with 132 additions and 123 deletions
15
Mage.Sets/src/mage/cache/CacheTest.java
vendored
15
Mage.Sets/src/mage/cache/CacheTest.java
vendored
|
|
@ -14,10 +14,13 @@ import java.util.Set;
|
|||
*/
|
||||
public class CacheTest {
|
||||
|
||||
/**
|
||||
* In case this test fails, it does mean that you need to update cache version in Sets.java
|
||||
*/
|
||||
@Test
|
||||
public void testCacheConsistency() {
|
||||
//Set<String> names = Sets.getCardNames();
|
||||
//Set<String> nonLandNames = Sets.getNonLandCardNames();
|
||||
Set<String> names = Sets.getCardNames();
|
||||
Set<String> nonLandNames = Sets.getNonLandCardNames();
|
||||
Set<String> creatureTypes = Sets.getCreatureTypes();
|
||||
|
||||
for (ExpansionSet set : Sets.getInstance().values()) {
|
||||
|
|
@ -29,6 +32,14 @@ public class CacheTest {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (!names.contains(card.getName())) {
|
||||
Assert.assertTrue("Couldn't find a card name in the cache: " + card.getName(), false);
|
||||
}
|
||||
if (!card.getCardType().contains(Constants.CardType.LAND)) {
|
||||
if (!nonLandNames.contains(card.getName())) {
|
||||
Assert.assertTrue("Couldn't find a non-land card name in the cache: " + card.getName(), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue