summaryrefslogtreecommitdiffstats
path: root/test/jrummikub/model/HandTest.java
blob: 25a9c1897b4e7f5762e120d79a4d19aaa64c77d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package jrummikub.model;

import org.junit.Before;
import org.junit.Test;
import static jrummikub.model.StoneColor.*;
import static org.junit.Assert.*;

public class HandTest {

	Hand hand;

	@Before
	public void setUp() {
		hand = new Hand();
	}

	@Test
	public void testSimpleDrop() {
		Stone stone1 = new Stone(1, RED);
		Stone stone2 = new Stone(5, RED);
		Stone stone3 = new Stone(2, RED);

		hand.drop(stone1, new Position(2, 0));
		hand.drop(stone2, new Position(3, 0));
		hand.drop(stone3, new Position(2.5f, 0));

		assertEquals(new Position(1.5f, 0), hand.getPosition(stone1));
		assertEquals(new Position(3.5f, 0), hand.getPosition(stone2));
		assertEquals(new Position(2.5f, 0), hand.getPosition(stone3));
	}
}