package org.mahjong4j.hands;

import org.junit.Before;
import org.junit.Test;
import org.mahjong4j.tile.MahjongTile;

import java.util.List;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

/**
 * @author yu1ro
 */
public class MahjongHandsNumOnlyTest {
    MahjongHands hands;

    @Before
    public void setUp() throws Exception {
        int[] tiles = {
            1, 1, 1, 1, 1, 1, 1, 1, 1,
            0, 1, 1, 1, 0, 0, 0, 0, 0,
            0, 0, 0, 0, 0, 0, 0, 0, 0,
            0, 0, 0, 0,
            0, 2, 0
        };
        MahjongTile last = MahjongTile.M6;
        hands = new MahjongHands(tiles, last);
    }

    @Test
    public void testFindMentsu() throws Exception {
        assertEquals(WinTypeEnum.NORMAL, hands.getWinType());
        List<MentsuComp> winSetList = hands.getMentsuCompList();
        assertEquals(1, winSetList.size());
    }

    @Test
    public void testWinMentsuList() throws Exception {
        List<MentsuComp> winSetList = hands.getMentsuCompList();
        for (MentsuComp winMentsuSet : winSetList) {
            assertEquals(0, winMentsuSet.getKantsuNum());
            assertEquals(0, winMentsuSet.getKotsuNum());
            assertEquals(4, winMentsuSet.getShuntsuNum());
            assertEquals(MahjongTile.HAT, winMentsuSet.getJanto().getTile());
        }
    }

    @Test
    public void testGetCanWin() throws Exception {
        assertTrue(hands.getCanWin());
    }
}
@@ -222,16 +222,65 @@
 ertTrue;
+%0Aimport static org.mahjong4j.tile.MahjongTile.M6;
 %0A%0A/**%0A *
@@ -439,16 +439,25 @@
 tiles = 
+new int%5B%5D
 %7B%0A      
@@ -622,16 +622,16 @@
      %7D;%0A
+
         
@@ -649,28 +649,16 @@
  last = 
-MahjongTile.
 M6;%0A    
@@ -1504,10 +1504,119 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void testGetLast() throws Exception %7B%0A        assertEquals(M6, hands.getLast());%0A    %7D
 %0A%7D

add get hands test