index_test.go 510 B

1234567891011121314151617181920212223242526
  1. package service
  2. import (
  3. "context"
  4. "encoding/json"
  5. "testing"
  6. . "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestRecoverIdx(t *testing.T) {
  9. var c = context.Background()
  10. Convey("recover idx", t, WithService(func(s *Service) {
  11. var d struct {
  12. Oid int64 `json:"oid"`
  13. Tp int8 `json:"tp"`
  14. Count int `json:"count"`
  15. Floor int `json:"floor"`
  16. }
  17. d.Oid = 78
  18. d.Tp = 2
  19. d.Count = 20
  20. content, _ := json.Marshal(&d)
  21. s.acionRecoverFloorIdx(c, &consumerMsg{Data: content})
  22. }))
  23. }