go-common/app/interface/main/account/service/member/web_info_test.go

97 lines
2.3 KiB
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package member
import (
"context"
. "github.com/smartystreets/goconvey/convey"
"go-common/app/interface/main/account/model"
"testing"
"time"
)
func TestService_SettingsInfo(t *testing.T) {
Convey("get settingsInfo info", t, func() {
Convey("when not timeout", func() {
time.Sleep(time.Second * 2)
res, err := s.SettingsInfo(context.TODO(), 110001260)
So(err, ShouldBeNil)
So(res, ShouldNotBeEmpty)
})
})
}
func TestService_LogLogin(t *testing.T) {
Convey("get settingsInfo info", t, func() {
Convey("when not timeout", func() {
time.Sleep(time.Second * 2)
res, err := s.LogLogin(context.TODO(), 110001260)
So(err, ShouldBeNil)
So(res, ShouldNotBeEmpty)
})
})
}
func TestService_LogCoin(t *testing.T) {
Convey("get settingsInfo info", t, func() {
Convey("when not timeout", func() {
time.Sleep(time.Second * 2)
res, err := s.LogCoin(context.TODO(), 1)
So(err, ShouldBeNil)
So(res, ShouldNotBeEmpty)
})
})
}
func TestService_LogExp(t *testing.T) {
Convey("get settingsInfo info", t, func() {
Convey("when not timeout", func() {
time.Sleep(time.Second * 2)
res, err := s.LogExp(context.TODO(), 110001260)
So(err, ShouldBeNil)
So(res, ShouldNotBeEmpty)
})
})
}
func TestService_LogMoral(t *testing.T) {
Convey("get settingsInfo info", t, func() {
Convey("when not timeout", func() {
time.Sleep(time.Second * 2)
res, err := s.LogMoral(context.TODO(), 110001260)
So(err, ShouldBeNil)
So(res, ShouldNotBeEmpty)
})
})
}
func TestService_Coin(t *testing.T) {
Convey("get settingsInfo info", t, func() {
Convey("when not timeout", func() {
time.Sleep(time.Second * 2)
res, err := s.Coin(context.TODO(), 1)
So(err, ShouldBeNil)
So(res, ShouldNotBeEmpty)
})
})
}
func TestService_UpdateSettings(t *testing.T) {
Convey("get settingsInfo info", t, func() {
Convey("when not timeout", func() {
time.Sleep(time.Second * 2)
err := s.UpdateSettings(context.TODO(), 110000092, &model.Settings{Uname: "test", Sex: "男"})
So(err, ShouldBeNil)
})
})
}
func TestService_Reward(t *testing.T) {
Convey("reward info", t, func() {
Convey("when not timeout", func() {
time.Sleep(time.Second * 2)
res, err := s.Reward(context.TODO(), 2)
So(err, ShouldBeNil)
So(res, ShouldNotBeEmpty)
})
})
}