reply_test.go 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package data
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. var (
  8. aid = int64(10098208)
  9. mid = int64(10920044)
  10. )
  11. func TestDataOpenReply(t *testing.T) {
  12. var (
  13. c = context.TODO()
  14. )
  15. convey.Convey("OpenReply", t, func(ctx convey.C) {
  16. err := d.OpenReply(c, aid, mid)
  17. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  18. ctx.So(err, convey.ShouldBeNil)
  19. })
  20. })
  21. }
  22. func TestDataCloseReply(t *testing.T) {
  23. var (
  24. c = context.TODO()
  25. )
  26. convey.Convey("CloseReply", t, func(ctx convey.C) {
  27. err := d.CloseReply(c, aid, mid)
  28. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  29. ctx.So(err, convey.ShouldBeNil)
  30. })
  31. })
  32. }
  33. func TestDataCheckReply(t *testing.T) {
  34. var (
  35. c = context.TODO()
  36. )
  37. convey.Convey("CheckReply", t, func(ctx convey.C) {
  38. replyState, err := d.CheckReply(c, aid)
  39. t.Logf("%d", replyState)
  40. ctx.Convey("Then err should be nil.replyState should not be nil.", func(ctx convey.C) {
  41. ctx.So(err, convey.ShouldBeNil)
  42. ctx.So(replyState, convey.ShouldNotBeNil)
  43. })
  44. })
  45. }