cp_test.go 1015 Bytes
Newer Older
hujiebin's avatar
hujiebin committed
1 2 3
package test

import (
hujiebin's avatar
hujiebin committed
4
	"git.hilo.cn/hilo-common/_const/enum/timezone_e"
hujiebin's avatar
hujiebin committed
5 6 7
	"git.hilo.cn/hilo-common/domain"
	"hilo-user/domain/model/cp_m"
	"testing"
hujiebin's avatar
hujiebin committed
8
	"time"
hujiebin's avatar
hujiebin committed
9 10 11 12 13 14 15 16 17 18
)

func TestInitCpAnniversary(t *testing.T) {
	err := cp_m.InitCpAnniversary(domain.CreateModelNil(), cp_m.CpRelation{
		Id:      1,
		UserId1: 7642,
		UserId2: 4549,
	}, "ar")
	println(err)
}
hujiebin's avatar
hujiebin committed
19 20

func TestCalcNextAnniversary(t *testing.T) {
hujiebin's avatar
hujiebin committed
21
	t2 := cp_m.CalcNextAnniversary(1686211996, time.Local)
hujiebin's avatar
hujiebin committed
22 23
	println(t2)
}
hujiebin's avatar
hujiebin committed
24 25 26 27 28 29 30 31 32

func TestCalLoc(t *testing.T) {
	loc := timezone_e.GetFixedTimezone("GMT+8")
	println(time.Now().In(loc).Format("2006-01-02 15:04:05"))
	loc = timezone_e.GetFixedTimezone("GMT+3")
	println(time.Now().In(loc).Format("2006-01-02 15:04:05"))
	loc = timezone_e.GetFixedTimezone("GMT+5")
	println(time.Now().In(loc).Format("2006-01-02 15:04:05"))
}
hujiebin's avatar
hujiebin committed
33 34 35

func TestSumCpScore(t *testing.T) {
	model := domain.CreateModelNil()
hujiebin's avatar
hujiebin committed
36
	old, err := cp_m.GetOldConnectCp(model, 7642, 4549)
hujiebin's avatar
hujiebin committed
37 38 39 40
	t.Logf("%v-%v", old, err)
	n := cp_m.SumCpPoints(model, 1)
	t.Logf("%v", n)
}