package org.mahjong4j.hands;

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

import static org.junit.Assert.assertEquals;
import static org.mahjong4j.tile.MahjongTile.*;

/**
 * @author yu1ro
 */
public class MentsuCompTest {
    private MentsuComp comp1;
    private Janto janto;

    @Before
    public void setUp() throws Exception {

        janto = new Janto(MahjongTile.M7);
        comp1 = new MentsuComp(janto);
    }

    @Test
    public void testSet() throws Exception {
        MahjongMentsu a, b, c, d;
        a = new Kotsu(false, M1);
        b = new Shuntsu(false, M5);
        c = new Kantsu(false, M2);
        d = new Shuntsu(false, S4);
        comp1.setMentsu(a);
        comp1.setMentsu(b);
        comp1.setMentsu(c);
        comp1.setMentsu(d);

        assertEquals(janto, comp1.getJanto());
        assertEquals(a, comp1.getKotsuList().get(0));
        assertEquals(b, comp1.getShuntsuList().get(0));
        assertEquals(c, comp1.getKantsuList().get(0));
        assertEquals(d, comp1.getShuntsuList().get(1));
    }
}
@@ -314,16 +314,262 @@
 o janto;
+%0A    private MahjongMentsu a, b, c, d;%0A    private Shuntsu shuntsu1 = new Shuntsu(true, P2);%0A    private Shuntsu shuntsu2 = new Shuntsu(false, S5);%0A    private Kotsu kotsu = new Kotsu(false, M4);%0A    private Kantsu kantsu = new Kantsu(true, CHN);
 %0A%0A    @B
@@ -704,103 +704,8 @@
 o);%0A
-    %7D%0A%0A    @Test%0A    public void testSet() throws Exception %7B%0A        MahjongMentsu a, b, c, d;
 %0A   
@@ -834,20 +834,19 @@
 tsu(
-fals
+tru
 e, S4);%0A
     
@@ -837,24 +837,92 @@
 (true, S4);%0A
+    %7D%0A%0A    @Test%0A    public void testSetMentsu() throws Exception %7B%0A
         comp
@@ -1295,10 +1295,653 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void testSetEachMentsu() throws Exception %7B%0A        comp1.setShuntsu(shuntsu1);%0A        comp1.setShuntsu(shuntsu2);%0A        comp1.setKotsu(kotsu);%0A        comp1.setKantsu(kantsu);%0A%0A        assertEquals(janto, comp1.getJanto());%0A%0A        assertEquals(shuntsu1, comp1.getShuntsuList().get(0));%0A        assertEquals(shuntsu2, comp1.getShuntsuList().get(1));%0A        assertEquals(kotsu, comp1.getKotsuList().get(0));%0A        assertEquals(kantsu, comp1.getKantsuList().get(0));%0A%0A        assertEquals(2, comp1.getShuntsuNum());%0A        assertEquals(1, comp1.getKantsuNum());%0A        assertEquals(1, comp1.getKotsuNum());%0A    %7D
 %0A%7D

complete mentsuComp test