monitor_test.go 869 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package service
  2. import (
  3. "context"
  4. "testing"
  5. "go-common/app/admin/main/dm/model"
  6. . "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestMonitorList(t *testing.T) {
  9. var (
  10. c = context.TODO()
  11. aid, cid, mid, p, ps int64 = 0, 0, 0, 1, 100
  12. kw, sort, order = "", "", ""
  13. state int32 = 1
  14. tp int32 = 1
  15. )
  16. Convey("test monitor list from search", t, func() {
  17. res, err := svr.MonitorList(c, tp, aid, cid, mid, state, kw, sort, order, p, ps)
  18. So(res, ShouldNotBeEmpty)
  19. So(err, ShouldBeNil)
  20. })
  21. }
  22. func TestUpdateMonitor(t *testing.T) {
  23. var (
  24. c = context.TODO()
  25. tp = model.SubTypeVideo
  26. oids = []int64{2, 99}
  27. )
  28. Convey("update dm subject monitor", t, func() {
  29. affect, err := svr.UpdateMonitor(c, tp, oids, 1)
  30. So(affect, ShouldBeGreaterThan, 0)
  31. So(err, ShouldBeNil)
  32. })
  33. }