package com.wuban.tron.explore.service.impl;

import com.wuban.tron.explore.BaseTest;
import com.wuban.tron.explore.entity.Census;
import com.wuban.tron.explore.service.CensusService;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;

import static org.junit.jupiter.api.Assertions.*;

class CensusServiceImplTest extends BaseTest {

    @Autowired
    private CensusService censusService;

    Census census;

    @BeforeEach
    void setUp() {
        census = Census.getInstance();
    }

    @Test
    void saveOrUpdateCensus() {
        this.censusService.saveOrUpdateCensus(census);

        census.setTotalBlockSize(1000L);
        census.setTotalTrans(1L);
        census.setTotalAccount(20L);
        this.censusService.saveOrUpdateCensus(census);
    }
}