You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
827 B
Go
56 lines
827 B
Go
package players
|
|
|
|
import (
|
|
"context"
|
|
"joybuywork/internal/repository/cache"
|
|
"testing"
|
|
|
|
_ "joybuywork/test"
|
|
)
|
|
|
|
func TestCoinStatus(t *testing.T) {
|
|
ctx := context.Background()
|
|
|
|
user, err := cache.NewFissionUser(ctx, 4602).FindById(276303329544409088)
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
|
|
user.LangMark = "zh"
|
|
|
|
kg, err := NewCoin(ctx, user)
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
|
|
status, err := kg.GetStatus()
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
|
|
t.Log(status)
|
|
}
|
|
|
|
func TestCoinGain(t *testing.T) {
|
|
ctx := context.Background()
|
|
|
|
user, err := cache.NewFissionUser(ctx, 4602).FindById(276303329544409088)
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
|
|
user.LangMark = "zh"
|
|
|
|
kg, err := NewCoin(ctx, user)
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
|
|
getCoin, status, err := kg.Gain()
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
|
|
t.Log(getCoin, status)
|
|
}
|