Create & Init Project...

This commit is contained in:
2019-04-22 18:49:16 +08:00
commit fc4fa37393
25440 changed files with 4054998 additions and 0 deletions

View File

@ -0,0 +1,74 @@
package stat
import (
"context"
"testing"
"github.com/smartystreets/goconvey/convey"
)
func TestStatipBanKey(t *testing.T) {
convey.Convey("ipBanKey", t, func(convCtx convey.C) {
var (
id = int64(0)
ip = ""
)
convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
key := ipBanKey(id, ip)
convCtx.Convey("Then key should not be nil.", func(convCtx convey.C) {
convCtx.So(key, convey.ShouldNotBeNil)
})
})
})
}
func TestStatbuvidBanKey(t *testing.T) {
convey.Convey("buvidBanKey", t, func(convCtx convey.C) {
var (
id = int64(0)
mid = int64(0)
ip = ""
buvid = ""
)
convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
key := buvidBanKey(id, mid, ip, buvid)
convCtx.Convey("Then key should not be nil.", func(convCtx convey.C) {
convCtx.So(key, convey.ShouldNotBeNil)
})
})
})
}
func TestStatIPBan(t *testing.T) {
convey.Convey("IPBan", t, func(convCtx convey.C) {
var (
c = context.Background()
id = int64(0)
ip = ""
)
convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
ban := d.IPBan(c, id, ip)
convCtx.Convey("Then ban should not be nil.", func(convCtx convey.C) {
convCtx.So(ban, convey.ShouldNotBeNil)
})
})
})
}
func TestStatBuvidBan(t *testing.T) {
convey.Convey("BuvidBan", t, func(convCtx convey.C) {
var (
c = context.Background()
id = int64(0)
mid = int64(0)
buvid = ""
ip = ""
)
convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
ban := d.BuvidBan(c, id, mid, ip, buvid)
convCtx.Convey("Then ban should not be nil.", func(convCtx convey.C) {
convCtx.So(ban, convey.ShouldNotBeNil)
})
})
})
}