service_test.go 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. package space
  2. import (
  3. "context"
  4. "reflect"
  5. "testing"
  6. "go-common/app/interface/main/app-interface/conf"
  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. t.Run(tt.name, func(t *testing.T) {
  21. if gotS := New(tt.args.c); !reflect.DeepEqual(gotS, tt.wantS) {
  22. t.Errorf("New() = %v, want %v", gotS, tt.wantS)
  23. }
  24. })
  25. }
  26. }
  27. func TestService_addCache(t *testing.T) {
  28. type args struct {
  29. f func()
  30. }
  31. tests := []struct {
  32. name string
  33. s *Service
  34. args args
  35. }{
  36. // TODO: Add test cases.
  37. }
  38. for _, tt := range tests {
  39. t.Run(tt.name, func(t *testing.T) {
  40. tt.s.addCache(tt.args.f)
  41. })
  42. }
  43. }
  44. func TestService_cacheproc(t *testing.T) {
  45. tests := []struct {
  46. name string
  47. s *Service
  48. }{
  49. // TODO: Add test cases.
  50. }
  51. for _, tt := range tests {
  52. t.Run(tt.name, func(t *testing.T) {
  53. tt.s.cacheproc()
  54. })
  55. }
  56. }
  57. func TestService_Ping(t *testing.T) {
  58. type args struct {
  59. c context.Context
  60. }
  61. tests := []struct {
  62. name string
  63. s *Service
  64. args args
  65. wantErr bool
  66. }{
  67. // TODO: Add test cases.
  68. }
  69. for _, tt := range tests {
  70. t.Run(tt.name, func(t *testing.T) {
  71. if err := tt.s.Ping(tt.args.c); (err != nil) != tt.wantErr {
  72. t.Errorf("Service.Ping() error = %v, wantErr %v", err, tt.wantErr)
  73. }
  74. })
  75. }
  76. }