service_test.go 480 B

12345678910111213141516171819202122232425262728293031
  1. package service
  2. import (
  3. "sync"
  4. "testing"
  5. "go-common/app/job/main/passport-game-cloud/conf"
  6. . "github.com/smartystreets/goconvey/convey"
  7. )
  8. var (
  9. once sync.Once
  10. s *Service
  11. )
  12. func startService() {
  13. if err := conf.Init(); err != nil {
  14. panic(err)
  15. }
  16. s = New(conf.Conf)
  17. }
  18. func TestNew(t *testing.T) {
  19. once.Do(startService)
  20. Convey("game app ids should ok", t, func() {
  21. So(s.gameAppIDs[0], ShouldEqual, _gameAppID)
  22. t.Logf("s.gameAppIDs: %v", s.gameAppIDs)
  23. })
  24. }