mask_test.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package service
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestMaskState(t *testing.T) {
  8. convey.Convey("mask state", t, func() {
  9. open, mobile, web, err := svr.MaskState(context.TODO(), 1, 1352)
  10. convey.So(err, convey.ShouldBeNil)
  11. t.Logf("===%d,%d,%d", open, mobile, web)
  12. })
  13. }
  14. func TestUpdateMaskState(t *testing.T) {
  15. convey.Convey("open mask", t, func() {
  16. err := svr.UpdateMaskState(context.TODO(), 1, 1352, 1, 0)
  17. convey.So(err, convey.ShouldBeNil)
  18. })
  19. }
  20. func TestGenerateMask(t *testing.T) {
  21. convey.Convey("generate mask", t, func() {
  22. err := svr.GenerateMask(context.TODO(), 1, 1352, 1)
  23. convey.So(err, convey.ShouldBeNil)
  24. })
  25. }
  26. func TestMaskUps(t *testing.T) {
  27. convey.Convey("test mask ups", t, func() {
  28. res, err := svr.MaskUps(context.Background(), 1, 50)
  29. convey.So(err, convey.ShouldBeNil)
  30. convey.So(res, convey.ShouldNotBeNil)
  31. t.Log(res, res.Result, res.Page)
  32. for _, v := range res.Result {
  33. t.Log(v)
  34. }
  35. })
  36. }
  37. func TestMaskUpOpen(t *testing.T) {
  38. convey.Convey("test mask up open", t, func() {
  39. err := svr.MaskUpOpen(context.Background(), []int64{1111, 142341123}, 1, "")
  40. convey.So(err, convey.ShouldBeNil)
  41. })
  42. }