1 package ru.alphatech.icfpc.cards.tests;
3 import junit.framework.Assert;
7 import ru.alphatech.icfpc.cards.Get;
8 import ru.alphatech.icfpc.cards.I;
9 import ru.alphatech.icfpc.game.ICFPCException;
10 import ru.alphatech.icfpc.game.IValue;
11 import ru.alphatech.icfpc.game.Player;
12 import ru.alphatech.icfpc.game.Value;
15 * @author indvdum (idea)
16 * @author 0-range (implementation)
20 public class TestGet extends Assert
23 public final void testReturnValue()
25 Player opponent = new Player();
26 Player proponent = new Player();
28 IValue i = new Value(0);
29 IValue value = new Value(99);
31 proponent.getSlot(((Value)i).getValue()).putValue(value);
32 assertEquals(value, new Get().returnValue(i, proponent, opponent));
36 public final void testNotSlotNumber()
38 Player opponent = new Player();
39 Player proponent = new Player();
44 new Get().returnValue(i, proponent, opponent);
47 catch (ICFPCException e)
54 public final void testInvalidSlotNumber()
56 Player opponent = new Player();
57 Player proponent = new Player();
61 IValue i = new Value(999);
62 new Get().returnValue(i, proponent, opponent);
65 catch (ICFPCException e)
72 public final void testIfSlotDead()
74 Player opponent = new Player();
75 Player proponent = new Player();
79 IValue i = new Value(0);
80 proponent.getSlot(((Value)i).getValue()).setVitality(0);
81 new Get().returnValue(i, proponent, opponent);
84 catch (ICFPCException e)