This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
JRummikub/test/jrummikub/model/HandTest.java
Bennet Gerlach 5767486e83 Test simple dropping on Hand
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@198 72836036-5685-4462-b002-a69064685172
2011-05-09 21:56:29 +02:00

31 lines
754 B
Java

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));
}
}