package com.td.boss;

import cn.hutool.json.JSONUtil;
import com.td.boss.common.pojo.Result;
import com.td.boss.game.complayersattri.controller.ComPlayersLuckyController;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class ComPlayerLuckyTests {
    private String userId = "1002";
    private int landId = 1;
    private int levelId = 2;

    @Autowired
    ComPlayersLuckyController comPlayersLuckyController;

    @Test
    public void getLandTools() {
        Result<?> landTools = comPlayersLuckyController.getLandTools();
        System.out.println(JSONUtil.toJsonStr(landTools));
    }

    @Test
    public void getLandLevelUp() {
        Result<?> landLevelUp = comPlayersLuckyController.getLandLevelUp();
        System.out.println(JSONUtil.toJsonStr(landLevelUp));
    }

    @Test
    public void useLuckyTools() {
        Result<?> landLevelUp = comPlayersLuckyController.useLuckyTools(userId, 1, landId);
        System.out.println(JSONUtil.toJsonStr(landLevelUp));
    }

    @Test
    public void landLevelUp() {
        Result<?> landLevelUp = comPlayersLuckyController.landLevelUp(userId, levelId, landId);
        System.out.println(JSONUtil.toJsonStr(landLevelUp));
    }

    @Test
    public void toSNB() {
        Result<?> result = comPlayersLuckyController.toSNB(userId, 50 * 20);
        System.out.println(JSONUtil.toJsonStr(result));
    }
}
