mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 21:02:08 -08:00
Revert "Mana updates"
This commit is contained in:
parent
f4871fe489
commit
68ff09c219
2 changed files with 26 additions and 107 deletions
|
|
@ -434,8 +434,6 @@ public class ManaTest {
|
|||
@Test
|
||||
public void shouldNotSubtractLessThan0() {
|
||||
// given
|
||||
expectedException.expect(ArithmeticException.class);
|
||||
expectedException.expectMessage("You can not subtract below 0");
|
||||
Mana thisMana = new Mana(2, 2, 2, 2, 2, 2, 2);
|
||||
Mana thatMana = new Mana(10, 1, 1, 1, 10, 1, 1);
|
||||
|
||||
|
|
@ -443,57 +441,13 @@ public class ManaTest {
|
|||
thisMana.subtract(thatMana);
|
||||
|
||||
// then
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void shouldNotAllowMinusSubtractionCost() {
|
||||
// given
|
||||
expectedException.expect(ArithmeticException.class);
|
||||
expectedException.expectMessage("You can not subtract below 0");
|
||||
Mana thisMana = new Mana(2, 2, 2, 2, 2, 2, 2);
|
||||
Mana thatMana = new Mana(10, 1, 1, 1, 10, 1, 1);
|
||||
|
||||
// when
|
||||
thisMana.subtractCost(thatMana);
|
||||
|
||||
// then
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void shouldUseExistingManaToPayColorless() {
|
||||
// given
|
||||
Mana available = new Mana();
|
||||
available.setRed(7);
|
||||
|
||||
Mana cost = new Mana();
|
||||
cost.setRed(4);
|
||||
cost.setColorless(2);
|
||||
|
||||
// when
|
||||
available.subtractCost(cost);
|
||||
|
||||
// then
|
||||
assertEquals(1, available.getRed());
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void shouldThrowExceptionOnUnavailableColorless() {
|
||||
// given
|
||||
expectedException.expect(ArithmeticException.class);
|
||||
expectedException.expectMessage("Not enough mana to pay colorless");
|
||||
Mana available = new Mana();
|
||||
available.setRed(4);
|
||||
|
||||
Mana cost = new Mana();
|
||||
cost.setRed(4);
|
||||
cost.setColorless(2);
|
||||
|
||||
// when
|
||||
available.subtractCost(cost);
|
||||
assertEquals(-8, thisMana.getRed());
|
||||
assertEquals(1, thisMana.getGreen());
|
||||
assertEquals(1, thisMana.getBlue());
|
||||
assertEquals(1, thisMana.getWhite());
|
||||
assertEquals(-8, thisMana.getBlack());
|
||||
assertEquals(1, thisMana.getColorless());
|
||||
assertEquals(1, thisMana.getAny());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue