reply_test.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoRegReply(t *testing.T) {
  8. convey.Convey("RegReply", t, func(ctx convey.C) {
  9. var (
  10. c = context.Background()
  11. id = int64(1)
  12. tid = int8(1)
  13. )
  14. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  15. err := d.RegReply(c, id, tid)
  16. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  17. ctx.So(err, convey.ShouldBeNil)
  18. })
  19. })
  20. })
  21. }
  22. func TestDaoDelReply(t *testing.T) {
  23. convey.Convey("DelReply", t, func(ctx convey.C) {
  24. var (
  25. c = context.Background()
  26. rpid = ""
  27. tp = ""
  28. oid = ""
  29. )
  30. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  31. err := d.DelReply(c, rpid, tp, oid)
  32. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  33. ctx.So(err, convey.ShouldBeNil)
  34. })
  35. })
  36. })
  37. }
  38. func TestDaoUpReplyState(t *testing.T) {
  39. convey.Convey("UpReplyState", t, func(ctx convey.C) {
  40. var (
  41. c = context.Background()
  42. oid = int64(0)
  43. rpid = int64(0)
  44. tp = int8(0)
  45. state = int8(0)
  46. )
  47. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  48. err := d.UpReplyState(c, oid, rpid, tp, state)
  49. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  50. ctx.So(err, convey.ShouldBeNil)
  51. })
  52. })
  53. })
  54. }