reply_test.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. package service
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. "go-common/app/job/main/videoup-report/model/archive"
  7. )
  8. var a = &archive.Archive{
  9. ID: 10098208,
  10. Mid: 10920044,
  11. Attribute: 1097728,
  12. State: 0,
  13. Round: 99,
  14. TypeID: 21,
  15. }
  16. func TestServicearcReply(t *testing.T) {
  17. var (
  18. c = context.Background()
  19. replySwitch = int64(1)
  20. )
  21. convey.Convey("arcReply", t, func(ctx convey.C) {
  22. err := s.arcReply(c, a, replySwitch)
  23. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  24. ctx.So(err, convey.ShouldBeNil)
  25. })
  26. })
  27. }
  28. func TestServiceopenReply(t *testing.T) {
  29. var (
  30. c = context.Background()
  31. )
  32. convey.Convey("openReply", t, func(ctx convey.C) {
  33. err := s.openReply(c, a, archive.ReplyOff)
  34. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  35. ctx.So(err, convey.ShouldBeNil)
  36. })
  37. })
  38. }
  39. func TestServicecloseReply(t *testing.T) {
  40. var (
  41. c = context.Background()
  42. )
  43. convey.Convey("closeReply", t, func(ctx convey.C) {
  44. err := s.closeReply(c, a, archive.ReplyOn)
  45. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  46. ctx.So(err, convey.ShouldBeNil)
  47. })
  48. })
  49. }