service_test.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. package service
  2. import (
  3. "context"
  4. "go-common/app/job/main/app-player/conf"
  5. "testing"
  6. . "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestNew(t *testing.T) {
  9. type args struct {
  10. c *conf.Config
  11. }
  12. tests := []struct {
  13. name string
  14. args args
  15. wantS *Service
  16. }{
  17. // TODO: Add test cases.
  18. }
  19. for _, tt := range tests {
  20. Convey(tt.name, t, func(t *testing.T) {
  21. gotS := New(tt.args.c)
  22. So(gotS, ShouldEqual, tt.wantS)
  23. })
  24. }
  25. }
  26. func TestService_Close(t *testing.T) {
  27. tests := []struct {
  28. name string
  29. s *Service
  30. }{
  31. // TODO: Add test cases.
  32. }
  33. for _, tt := range tests {
  34. t.Run(tt.name, func(t *testing.T) {
  35. tt.s.Close()
  36. })
  37. }
  38. }
  39. func TestService_Ping(t *testing.T) {
  40. type args struct {
  41. c context.Context
  42. }
  43. tests := []struct {
  44. name string
  45. s *Service
  46. args args
  47. wantErr bool
  48. }{
  49. // TODO: Add test cases.
  50. }
  51. for _, tt := range tests {
  52. t.Run(tt.name, func(t *testing.T) {
  53. if err := tt.s.Ping(tt.args.c); (err != nil) != tt.wantErr {
  54. t.Errorf("Service.Ping() error = %v, wantErr %v", err, tt.wantErr)
  55. }
  56. })
  57. }
  58. }