Newer
Older
Algolike / src / test / java / controls / BotIntelligenceTest.java
package controls;

import org.junit.jupiter.api.Test;

import static controls.ConstantMethods.printAlgoState;
import static org.junit.jupiter.api.Assertions.assertEquals;


class BotIntelligenceTest {

    /**
     * 正しく未確定数字を計算ができる
     */
    @Test
    void testCalc() {
        StepScheduler stepScheduler=new StepScheduler();

        var algo = stepScheduler.algo;
        BotIntelligence botIntelligence=new BotIntelligence(new TurnBot(algo));
        stepScheduler.isATurn = false;
        var candidate=botIntelligence.calculateCandidate();
        printAlgoState(algo);
        var s= "[";
        for (var i : candidate)s+=i+" ";
        s+="]";
        System.out.println(s);
    }

    /**
     * 各手札のカードに対して候補を算出できる
     */
    @Test
    void calc(){
        StepScheduler stepScheduler=new StepScheduler();

        var algo = stepScheduler.algo;
        BotIntelligence botIntelligence=new BotIntelligence(new TurnBot(algo));
        var iniHandsANum = algo.getHandsA().size();
        var initDeckNum=algo.getDeck().size();
        //正解のカードを選択させるための変数
        var guess = algo.getHandsB().get(0).getKey();
        var target = 1;
        //テスト対象メソッド

        algo.inputDrawA(guess,target);

        stepScheduler.isATurn = false;
        printAlgoState(algo);
        botIntelligence.assignCandidateNumberEachHand();
    }
}