mirror of
https://github.com/magefree/mage.git
synced 2026-01-19 01:39:58 -08:00
a few more refactors
This commit is contained in:
parent
8a3bc359ec
commit
542ea3664d
2 changed files with 10 additions and 11 deletions
|
|
@ -49,7 +49,7 @@ public class SerializationTest extends CardTestPlayerBase {
|
|||
Object compressed = CompressUtil.compress(permanent);
|
||||
Assert.assertTrue("Must be zip", compressed instanceof ZippedObjectImpl);
|
||||
PermanentImpl uncompressed = (PermanentImpl) CompressUtil.decompress(compressed);
|
||||
Assert.assertEquals("Must be same", permanent.getName(), uncompressed.getName());
|
||||
Assert.assertTrue("Must be same", permanent.sharesName(uncompressed, currentGame));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -68,7 +68,7 @@ public class SerializationTest extends CardTestPlayerBase {
|
|||
Object compressed = CompressUtil.compress(permanent);
|
||||
Assert.assertTrue("Must be zip", compressed instanceof ZippedObjectImpl);
|
||||
PermanentImpl uncompressed = (PermanentImpl) CompressUtil.decompress(compressed);
|
||||
Assert.assertEquals("Must be same", permanent.getName(), uncompressed.getName());
|
||||
Assert.assertTrue("Must be same", permanent.sharesName(uncompressed, currentGame));
|
||||
|
||||
// ensure that it was marked damage
|
||||
permanent.applyDamage(currentGame);
|
||||
|
|
@ -92,7 +92,7 @@ public class SerializationTest extends CardTestPlayerBase {
|
|||
Object compressed = CompressUtil.compress(card);
|
||||
Assert.assertTrue("Must be zip", compressed instanceof ZippedObjectImpl);
|
||||
Card uncompressed = (Card) CompressUtil.decompress(compressed);
|
||||
Assert.assertEquals("Must be same", card.getName(), uncompressed.getName());
|
||||
Assert.assertTrue("Must be same", card.sharesName(uncompressed, currentGame));
|
||||
}
|
||||
|
||||
// permanent
|
||||
|
|
@ -100,7 +100,7 @@ public class SerializationTest extends CardTestPlayerBase {
|
|||
Object compressed = CompressUtil.compress(testPermanent);
|
||||
Assert.assertTrue("Must be zip", compressed instanceof ZippedObjectImpl);
|
||||
Card uncompressed = (Card) CompressUtil.decompress(compressed);
|
||||
Assert.assertEquals("Must be same", testPermanent.getName(), uncompressed.getName());
|
||||
Assert.assertTrue("Must be same", testPermanent.sharesName(uncompressed, currentGame));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ import java.util.stream.Collectors;
|
|||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
|
|
@ -74,7 +73,7 @@ public class BoosterGenerationTest extends MageTestPlayerBase {
|
|||
for (Ability ability : card.getAbilities()) {
|
||||
if (ability instanceof PartnerWithAbility) {
|
||||
if (foundPartner) {
|
||||
Assert.assertEquals(Partner, card.getName());
|
||||
assertTrue(card.hasName(Partner, currentGame));
|
||||
} else {
|
||||
foundPartner = true;
|
||||
Partner = ((PartnerWithAbility) ability).getPartnerName();
|
||||
|
|
@ -324,13 +323,13 @@ public class BoosterGenerationTest extends MageTestPlayerBase {
|
|||
"Only one snow land, must be basic or common",
|
||||
snowLand.isBasic() || snowLand.getRarity() == Rarity.COMMON
|
||||
);
|
||||
assertNotEquals(
|
||||
assertFalse(
|
||||
"Only one snow land, can't be Shimmerdrift Vale",
|
||||
"Shimmerdrift Vale", snowLand.getName()
|
||||
snowLand.hasName("Shimmerdrift Vale", currentGame)
|
||||
);
|
||||
assertNotEquals(
|
||||
assertFalse(
|
||||
"Only one snow land, can't be Faceless Haven",
|
||||
"Faceless Haven", snowLand.getName()
|
||||
snowLand.hasName("Faceless Haven", currentGame)
|
||||
);
|
||||
break;
|
||||
case 2:
|
||||
|
|
@ -363,7 +362,7 @@ public class BoosterGenerationTest extends MageTestPlayerBase {
|
|||
|
||||
foundMDFC |= mdfcCount > 0;
|
||||
foundNoMDFC |= mdfcCount == 0;
|
||||
foundVale |= booster.stream().map(MageObject::getName).anyMatch("Shimmerdrift Vale"::equals);
|
||||
foundVale |= booster.stream().anyMatch(card -> card.hasName("Shimmerdrift Vale", currentGame));
|
||||
if (foundVale && foundMDFC && foundNoMDFC && i > 20) {
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue