package com.zd.exam.service;


import com.zd.common.core.enums.PointRecordType;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

import org.junit.jupiter.api.TestInstance;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;


/**
 * @Author: zhoupan
 * @Date: 2021/09/07/14:23
 * @Description:
 */
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@SpringBootTest
@DisplayName("积分记录")
@Transactional
class IElPointsRecordServiceTest {


    @Autowired
    IElPointsRecordService pointsRecordService;

    @Test

    @DisplayName("积分记录新增")
    public void createRecord() {
        //测试消耗
        Boolean record = pointsRecordService.createRecord(1L, -200L, 1, PointRecordType.USE, "测试");
        Assert.isTrue(record, "积分消耗失败！");


        //测试获取
        Boolean record2 = pointsRecordService.createRecord(1L, 200L, 1, PointRecordType.GET, "测试");
    }

}
