callback_test.go 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. package callback
  2. import (
  3. "context"
  4. "flag"
  5. "path/filepath"
  6. "testing"
  7. "time"
  8. "go-common/app/interface/main/app-wall/conf"
  9. . "github.com/smartystreets/goconvey/convey"
  10. )
  11. var (
  12. d *Dao
  13. )
  14. func init() {
  15. dir, _ := filepath.Abs("../../cmd/app-wall-test.toml")
  16. flag.Set("conf", dir)
  17. conf.Init()
  18. d = New(conf.Conf)
  19. time.Sleep(time.Second)
  20. }
  21. func TestNew(t *testing.T) {
  22. type args struct {
  23. c *conf.Config
  24. }
  25. tests := []struct {
  26. name string
  27. args args
  28. wantD *Dao
  29. }{
  30. // TODO: Add test cases.
  31. }
  32. for _, tt := range tests {
  33. Convey(tt.name, t, func() {
  34. gotD := New(tt.args.c)
  35. So(gotD, ShouldResemble, tt.wantD)
  36. })
  37. }
  38. }
  39. func TestDao_GdtCallback(t *testing.T) {
  40. type args struct {
  41. c context.Context
  42. appID string
  43. appType string
  44. aderID string
  45. idfa string
  46. cb string
  47. now time.Time
  48. }
  49. tests := []struct {
  50. name string
  51. args args
  52. wantErr error
  53. }{
  54. // TODO: Add test cases.
  55. }
  56. for _, tt := range tests {
  57. Convey(tt.name, t, func() {
  58. err := d.GdtCallback(tt.args.c, tt.args.appID, tt.args.appType, tt.args.aderID, tt.args.idfa, tt.args.cb, tt.args.now)
  59. So(err, ShouldEqual, tt.wantErr)
  60. })
  61. }
  62. }
  63. func TestDao_ShikeCallback(t *testing.T) {
  64. type args struct {
  65. c context.Context
  66. idfa string
  67. cb string
  68. now time.Time
  69. }
  70. tests := []struct {
  71. name string
  72. args args
  73. wantErr error
  74. }{
  75. // TODO: Add test cases.
  76. }
  77. for _, tt := range tests {
  78. Convey(tt.name, t, func() {
  79. err := d.ShikeCallback(tt.args.c, tt.args.idfa, tt.args.cb, tt.args.now)
  80. So(err, ShouldEqual, tt.wantErr)
  81. })
  82. }
  83. }
  84. func TestDao_DontinCallback(t *testing.T) {
  85. type args struct {
  86. c context.Context
  87. idfa string
  88. clickid string
  89. }
  90. tests := []struct {
  91. name string
  92. args args
  93. wantErr error
  94. }{
  95. // TODO: Add test cases.
  96. }
  97. for _, tt := range tests {
  98. Convey(tt.name, t, func() {
  99. err := d.DontinCallback(tt.args.c, tt.args.idfa, tt.args.clickid)
  100. So(err, ShouldEqual, tt.wantErr)
  101. })
  102. }
  103. }
  104. func TestDao_ToutiaoCallback(t *testing.T) {
  105. type args struct {
  106. c context.Context
  107. cb string
  108. eventType string
  109. }
  110. tests := []struct {
  111. name string
  112. args args
  113. wantErr error
  114. }{
  115. // TODO: Add test cases.
  116. }
  117. for _, tt := range tests {
  118. Convey(tt.name, t, func() {
  119. err := d.ToutiaoCallback(tt.args.c, tt.args.cb, tt.args.eventType)
  120. So(err, ShouldEqual, tt.wantErr)
  121. })
  122. }
  123. }