grpc_test.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoRankElecUpdateOrder(t *testing.T) {
  8. convey.Convey("RankElecUpdateOrder", t, func(ctx convey.C) {
  9. var (
  10. c = context.Background()
  11. avID = int64(0)
  12. upMID = int64(0)
  13. payMID = int64(0)
  14. ver = int64(0)
  15. fee = int64(0)
  16. )
  17. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  18. err := d.RankElecUpdateOrder(c, avID, upMID, payMID, ver, fee)
  19. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  20. ctx.So(err, convey.ShouldBeNil)
  21. })
  22. })
  23. })
  24. }
  25. func TestDaoRankElecUpdateMessage(t *testing.T) {
  26. convey.Convey("RankElecUpdateMessage", t, func(ctx convey.C) {
  27. var (
  28. c = context.Background()
  29. avID = int64(0)
  30. upMID = int64(0)
  31. payMID = int64(0)
  32. ver = int64(0)
  33. message = ""
  34. hidden bool
  35. )
  36. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  37. err := d.RankElecUpdateMessage(c, avID, upMID, payMID, ver, message, hidden)
  38. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  39. ctx.So(err, convey.ShouldBeNil)
  40. })
  41. })
  42. })
  43. }