up_rank_test.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package upcrm
  2. import (
  3. "testing"
  4. "time"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestUpcrmQueryUpRank(t *testing.T) {
  8. convey.Convey("QueryUpRank", t, func(ctx convey.C) {
  9. var (
  10. rankType = int(0)
  11. date = time.Now()
  12. )
  13. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  14. result, err := d.QueryUpRank(rankType, date)
  15. ctx.Convey("Then err should be nil.result should not be nil.", func(ctx convey.C) {
  16. ctx.So(err, convey.ShouldBeNil)
  17. ctx.So(result, convey.ShouldNotBeNil)
  18. })
  19. })
  20. })
  21. }
  22. func TestUpcrmQueryUpRankAll(t *testing.T) {
  23. convey.Convey("QueryUpRankAll", t, func(ctx convey.C) {
  24. var (
  25. date = time.Now()
  26. )
  27. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  28. result, err := d.QueryUpRankAll(date)
  29. ctx.Convey("Then err should be nil.result should not be nil.", func(ctx convey.C) {
  30. ctx.So(err, convey.ShouldBeNil)
  31. ctx.So(result, convey.ShouldNotBeNil)
  32. })
  33. })
  34. })
  35. }
  36. func TestUpcrmGetUpRankLatestDate(t *testing.T) {
  37. convey.Convey("GetUpRankLatestDate", t, func(ctx convey.C) {
  38. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  39. date, err := d.GetUpRankLatestDate()
  40. ctx.Convey("Then err should be nil.date should not be nil.", func(ctx convey.C) {
  41. ctx.So(err, convey.ShouldBeNil)
  42. ctx.So(date, convey.ShouldNotBeNil)
  43. })
  44. })
  45. })
  46. }