channel_archive_test.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package service
  2. import (
  3. "context"
  4. "testing"
  5. . "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestService_SortChannelArc(t *testing.T) {
  8. Convey("test sort channel arc", t, WithService(func(s *Service) {
  9. var (
  10. mid = int64(27515260)
  11. cid = int64(37)
  12. aid = int64(5462035)
  13. preAid = 1
  14. )
  15. err := s.SortChannelArc(context.Background(), mid, cid, aid, preAid)
  16. So(err, ShouldBeNil)
  17. }))
  18. }
  19. func TestService_AddChannelArc(t *testing.T) {
  20. Convey("add channel arc", t, WithService(func(s *Service) {
  21. mid := int64(27515260)
  22. cid := int64(34)
  23. aid := []int64{5462036}
  24. _, err := s.AddChannelArc(context.Background(), mid, cid, aid)
  25. So(err, ShouldBeNil)
  26. }))
  27. }
  28. func TestService_archives(t *testing.T) {
  29. Convey("archives", t, WithService(func(s *Service) {
  30. aids := []int64{4053640, 4053639, 4053638, 4053637, 4053635, 4053634, 4053633, 4053632, 4053631, 4053630, 4053629, 4053628, 4053627, 4053626, 4053625, 4053624, 4053623, 4053622, 4053617, 4053611, 4053608, 4053607, 4053605, 4053604, 4053603, 4053602, 4053600, 4053599, 4053598, 4053596, 4053595, 4053594, 4053593, 4053592, 4053591, 4053590, 4053589, 4053588, 4053587, 4053586, 4053585, 4053584, 4053583, 4053582, 4053581, 4053579, 4053577, 4053576, 4053575, 4053574}
  31. arcs, err := s.archives(context.Background(), aids)
  32. So(err, ShouldBeNil)
  33. for _, v := range arcs {
  34. Printf("%+v", v)
  35. }
  36. }))
  37. }