src/test/java/ru/alphatech/icfpc/cards/tests/TestSucc.java
changeset 97 89f13f209302
parent 43 4ba83edc4361
child 119 f2ec9adedb3b
equal deleted inserted replaced
73:50ef27b8b7dc 97:89f13f209302
    12 import ru.alphatech.icfpc.game.Value;
    12 import ru.alphatech.icfpc.game.Value;
    13 
    13 
    14 public class TestSucc extends TestCase
    14 public class TestSucc extends TestCase
    15 {
    15 {
    16 	@Test
    16 	@Test
       
    17 	public void testEqualValue()
       
    18 	{
       
    19 		Player opponent = new Player();
       
    20 		Player proponent = new Player();
       
    21 		
       
    22 		assertEquals(65535, ((Value)new Succ().returnValue(new Value(65535), proponent, opponent)).getValue());
       
    23 	}
       
    24 
       
    25 	@Test
       
    26 	public void testBiggestValue()
       
    27 	{
       
    28 		Player opponent = new Player();
       
    29 		Player proponent = new Player();
       
    30 
       
    31 		assertEquals(65535, ((Value)new Succ().returnValue(new Value(65536), proponent, opponent)).getValue());
       
    32 	}
       
    33 
       
    34 	@Test
    17 	public void testValue()
    35 	public void testValue()
    18 	{
    36 	{
    19 		Player opponent = new Player();
    37 		Player opponent = new Player();
    20 		Player proponent = new Player();
    38 		Player proponent = new Player();
    21 		IValue x = new Value(10);
    39 
       
    40 		assertEquals(11, ((Value)new Succ().returnValue(new Value(10), proponent, opponent)).getValue());
       
    41 	}
       
    42 
       
    43 	@Test
       
    44 	public void testErrorValue()
       
    45 	{
       
    46 		Player opponent = new Player();
       
    47 		Player proponent = new Player();
    22 		IValue i = new I();
    48 		IValue i = new I();
    23 		assertEquals(65535, ((Value)new Succ().returnValue(new Value(65535), proponent, opponent)).getValue());
    49 
    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
    50 		try
    27 		{
    51 		{
    28 			new Succ().returnValue(i, proponent, opponent);
    52 			new Succ().returnValue(i, proponent, opponent);
    29 			assertFalse(true);
    53 			assertFalse(true);
    30 		}
    54 		}