47 lines
1.4 KiB
Go
47 lines
1.4 KiB
Go
package unit
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
func TestChampionshipReward(t *testing.T) {
|
|
player := getTestPlayer()
|
|
player.GetChampshipMod().AddScore([]int{15, 15, 15})
|
|
todayAid, yestAid := player.GetChampshipActivityId()
|
|
items := player.GetChampshipReward(todayAid)
|
|
fmt.Printf("today id %d items : %v\n", todayAid, items)
|
|
player.GetChampshipMod().ZeroUpdate(todayAid)
|
|
player.GetChampshipMod().AddScore([]int{15, 15, 15})
|
|
yestAid = 0
|
|
items = player.GetChampshipReward(yestAid)
|
|
fmt.Printf("yesterday id %d items : %v\n", yestAid, items)
|
|
}
|
|
|
|
func TestChampionshipRankReward(t *testing.T) {
|
|
player := getTestPlayer()
|
|
player.GetChampshipMod().AddScore([]int{15, 15, 15})
|
|
_, yestAid := player.GetChampshipActivityId()
|
|
items, err := player.GetChampshipRankReward(1, yestAid)
|
|
if err != nil {
|
|
fmt.Printf("get rank reward error : %v\n", err)
|
|
} else {
|
|
fmt.Printf("yesterday id %d rank reward items : %v\n", yestAid, items)
|
|
}
|
|
yestAid = 0
|
|
items, err = player.GetChampshipRankReward(2, yestAid)
|
|
if err != nil {
|
|
fmt.Printf("get rank reward error : %v\n", err)
|
|
} else {
|
|
fmt.Printf("yesterday id %d rank reward items : %v\n", yestAid, items)
|
|
}
|
|
}
|
|
|
|
func TestChampionshipZeroUpdate(t *testing.T) {
|
|
player := getTestPlayer()
|
|
player.GetChampshipMod().AddScore([]int{15, 15, 15})
|
|
todayAid, _ := player.GetChampshipActivityId()
|
|
fmt.Printf("before zero update today id %d score : %d\n", todayAid, player.GetChampshipMod().GetScore())
|
|
player.ChampionshipZeroUpdate()
|
|
}
|