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 正しく未確定数字を計算ができる() {
        StepScheduler stepScheduler=new StepScheduler();
        BotIntelligence botIntelligence=new BotIntelligence();
        var algo = stepScheduler.algo;
        stepScheduler.isATurn = false;
        var candidate=botIntelligence.calculateCandidate(stepScheduler);
        printAlgoState(algo);
        var s= "[";
        for (var i : candidate)s+=i+" ";
        s+="]";
        System.out.println(s);
    }
    @Test
    void 各手札のカードに対して候補を算出できる(){
        StepScheduler stepScheduler=new StepScheduler();
        BotIntelligence botIntelligence=new BotIntelligence();
        var algo = stepScheduler.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(stepScheduler);
    }
}