|
1 package ru.alphatech.icfpc.cards.tests; |
|
2 |
|
3 import junit.framework.Assert; |
|
4 |
|
5 import org.junit.Test; |
|
6 |
|
7 import ru.alphatech.icfpc.cards.Dbl; |
|
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; |
|
13 |
|
14 public class TestDbl extends Assert |
|
15 { |
|
16 @Test |
|
17 public void testEqualValue() |
|
18 { |
|
19 Player opponent = new Player(); |
|
20 Player proponent = new Player(); |
|
21 assertEquals(65535, ((Value)new Dbl().returnValue(new Value(32768), proponent, opponent)).getValue()); |
|
22 } |
|
23 |
|
24 public void testBiggestValue() |
|
25 { |
|
26 Player opponent = new Player(); |
|
27 Player proponent = new Player(); |
|
28 |
|
29 assertEquals(65535, ((Value)new Dbl().returnValue(new Value(35000), proponent, opponent)).getValue()); |
|
30 } |
|
31 |
|
32 public void testValue() |
|
33 { |
|
34 Player opponent = new Player(); |
|
35 Player proponent = new Player(); |
|
36 |
|
37 assertEquals(22, ((Value)new Dbl().returnValue(new Value(11), proponent, opponent)).getValue()); |
|
38 } |
|
39 |
|
40 public void testErrorValue() |
|
41 { |
|
42 Player opponent = new Player(); |
|
43 Player proponent = new Player(); |
|
44 IValue i = new I(); |
|
45 try |
|
46 { |
|
47 new Dbl().returnValue(i, proponent, opponent); |
|
48 assertFalse(true); |
|
49 } |
|
50 catch (ICFPCException e) |
|
51 { |
|
52 assertTrue(true); |
|
53 } |
|
54 } |
|
55 } |