ping_test.go 1.1 KB

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