retry_test.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. package offer
  2. import (
  3. "context"
  4. "testing"
  5. "time"
  6. )
  7. func TestService_retryproc(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.retryproc()
  17. })
  18. }
  19. }
  20. func Test_retry(t *testing.T) {
  21. type args struct {
  22. callback func() error
  23. retry int
  24. sleep time.Duration
  25. }
  26. tests := []struct {
  27. name string
  28. args args
  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. if err := retry(tt.args.callback, tt.args.retry, tt.args.sleep); (err != nil) != tt.wantErr {
  36. t.Errorf("retry() error = %v, wantErr %v", err, tt.wantErr)
  37. }
  38. })
  39. }
  40. }
  41. func TestService_syncRetry(t *testing.T) {
  42. type args struct {
  43. c context.Context
  44. action string
  45. os string
  46. imei string
  47. androidid string
  48. mac string
  49. }
  50. tests := []struct {
  51. name string
  52. s *Service
  53. args args
  54. wantErr bool
  55. }{
  56. // TODO: Add test cases.
  57. }
  58. for _, tt := range tests {
  59. t.Run(tt.name, func(t *testing.T) {
  60. if err := tt.s.syncRetry(tt.args.c, tt.args.action, tt.args.os, tt.args.imei, tt.args.androidid, tt.args.mac); (err != nil) != tt.wantErr {
  61. t.Errorf("Service.syncRetry() error = %v, wantErr %v", err, tt.wantErr)
  62. }
  63. })
  64. }
  65. }