active_test.go 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. package offer
  2. import (
  3. "reflect"
  4. "testing"
  5. "go-common/app/job/main/app-wall/model/offer"
  6. )
  7. func TestService_activeConsumer(t *testing.T) {
  8. tests := []struct {
  9. name string
  10. s *Service
  11. }{
  12. // TODO: Add test cases.
  13. }
  14. for _, tt := range tests {
  15. t.Run(tt.name, func(t *testing.T) {
  16. tt.s.activeConsumer()
  17. })
  18. }
  19. }
  20. func TestService_checkMsgIllegal(t *testing.T) {
  21. type args struct {
  22. msg []byte
  23. }
  24. tests := []struct {
  25. name string
  26. s *Service
  27. args args
  28. wantActive *offer.ActiveMsg
  29. wantErr bool
  30. }{
  31. // TODO: Add test cases.
  32. }
  33. for _, tt := range tests {
  34. t.Run(tt.name, func(t *testing.T) {
  35. gotActive, err := tt.s.checkMsgIllegal(tt.args.msg)
  36. if (err != nil) != tt.wantErr {
  37. t.Errorf("Service.checkMsgIllegal() error = %v, wantErr %v", err, tt.wantErr)
  38. return
  39. }
  40. if !reflect.DeepEqual(gotActive, tt.wantActive) {
  41. t.Errorf("Service.checkMsgIllegal() = %v, want %v", gotActive, tt.wantActive)
  42. }
  43. })
  44. }
  45. }
  46. func TestService_activeproc(t *testing.T) {
  47. tests := []struct {
  48. name string
  49. s *Service
  50. }{
  51. // TODO: Add test cases.
  52. }
  53. for _, tt := range tests {
  54. t.Run(tt.name, func(t *testing.T) {
  55. tt.s.activeproc()
  56. })
  57. }
  58. }
  59. func TestService_active(t *testing.T) {
  60. type args struct {
  61. msg *offer.ActiveMsg
  62. }
  63. tests := []struct {
  64. name string
  65. s *Service
  66. args args
  67. }{
  68. // TODO: Add test cases.
  69. }
  70. for _, tt := range tests {
  71. t.Run(tt.name, func(t *testing.T) {
  72. tt.s.active(tt.args.msg)
  73. })
  74. }
  75. }