archive_test.go 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. package service
  2. import (
  3. "context"
  4. "encoding/json"
  5. "testing"
  6. . "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestService_UpArcStat(t *testing.T) {
  9. Convey("test up stat", t, WithService(func(s *Service) {
  10. mid := int64(883968)
  11. data, err := s.UpArcStat(context.Background(), mid)
  12. So(err, ShouldBeNil)
  13. Printf("%+v", data)
  14. }))
  15. }
  16. func TestService_SetTopArc(t *testing.T) {
  17. Convey("test set top arc", t, WithService(func(s *Service) {
  18. mid := int64(15555180)
  19. aid := int64(5464686)
  20. reason := "11123"
  21. err := s.SetTopArc(context.Background(), mid, aid, reason)
  22. So(err, ShouldBeNil)
  23. }))
  24. }
  25. func TestService_TopArc(t *testing.T) {
  26. Convey("test top arc", t, WithService(func(s *Service) {
  27. mid := int64(0)
  28. vmid := int64(15555180)
  29. data, err := s.TopArc(context.Background(), mid, vmid)
  30. So(err, ShouldBeNil)
  31. str, _ := json.Marshal(data)
  32. Println(string(str))
  33. }))
  34. }
  35. func TestService_DelTopArc(t *testing.T) {
  36. Convey("test del top arc", t, WithService(func(s *Service) {
  37. mid := int64(16913)
  38. err := s.DelTopArc(context.Background(), mid)
  39. So(err, ShouldBeNil)
  40. }))
  41. }
  42. func TestService_Masterpiece(t *testing.T) {
  43. Convey("test masterpiece", t, WithService(func(s *Service) {
  44. mid := int64(0)
  45. vmid := int64(15555180)
  46. data, err := s.Masterpiece(context.Background(), mid, vmid)
  47. So(err, ShouldBeNil)
  48. str, _ := json.Marshal(data)
  49. Println(string(str))
  50. }))
  51. }
  52. func TestService_EditMasterpiece(t *testing.T) {
  53. Convey("test masterpiece", t, WithService(func(s *Service) {
  54. mid := int64(15555180)
  55. preAid := int64(5464686)
  56. aid := int64(10098536)
  57. //aid := int64(5464827)
  58. reason := "test edit"
  59. err := s.EditMasterpiece(context.Background(), mid, preAid, aid, reason)
  60. So(err, ShouldBeNil)
  61. }))
  62. }
  63. func TestService_AddMasterpiece(t *testing.T) {
  64. Convey("test masterpiece", t, WithService(func(s *Service) {
  65. mid := int64(15555180)
  66. aid := int64(5464827)
  67. reason := "test add"
  68. err := s.AddMasterpiece(context.Background(), mid, aid, reason)
  69. So(err, ShouldBeNil)
  70. }))
  71. }
  72. func TestService_CancelMasterpiece(t *testing.T) {
  73. Convey("test masterpiece", t, WithService(func(s *Service) {
  74. mid := int64(15555180)
  75. aid := int64(5464827)
  76. err := s.CancelMasterpiece(context.Background(), mid, aid)
  77. So(err, ShouldBeNil)
  78. }))
  79. }