equal
deleted
inserted
replaced
|
1 package ru.alphatech.icfpc.cards.tests; |
|
2 |
|
3 import junit.framework.TestCase; |
|
4 |
|
5 import org.junit.Test; |
|
6 |
|
7 import ru.alphatech.icfpc.cards.I; |
|
8 import ru.alphatech.icfpc.cards.Succ; |
|
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; |
|
13 |
|
14 public class TestSucc extends TestCase |
|
15 { |
|
16 @Test |
|
17 public void testValue() |
|
18 { |
|
19 Player opponent = new Player(); |
|
20 Player proponent = new Player(); |
|
21 IValue x = new Value(10); |
|
22 IValue i = new I(); |
|
23 assertEquals(65535, ((Value)new Succ().returnValue(new Value(65535), proponent, opponent)).getValue()); |
|
24 assertEquals(65535, ((Value)new Succ().returnValue(new Value(65536), proponent, opponent)).getValue()); |
|
25 assertEquals(11, ((Value)new Succ().returnValue(new Value(10), proponent, opponent)).getValue()); |
|
26 try |
|
27 { |
|
28 new Succ().returnValue(i, proponent, opponent); |
|
29 assertFalse(true); |
|
30 } |
|
31 catch (ICFPCException e) |
|
32 { |
|
33 assertTrue(true); |
|
34 } |
|
35 } |
|
36 } |