phase_three_test.go 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. package data
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDatareverseString(t *testing.T) {
  8. convey.Convey("reverseString", t, func(ctx convey.C) {
  9. var (
  10. s = ""
  11. )
  12. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  13. p1 := reverseString(s)
  14. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  15. ctx.So(p1, convey.ShouldNotBeNil)
  16. })
  17. })
  18. })
  19. }
  20. func TestDatafansRowKey(t *testing.T) {
  21. convey.Convey("fansRowKey", t, func(ctx convey.C) {
  22. var (
  23. id = int64(0)
  24. ty = int(0)
  25. )
  26. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  27. p1 := fansRowKey(id, ty)
  28. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  29. ctx.So(p1, convey.ShouldNotBeNil)
  30. })
  31. })
  32. })
  33. }
  34. func TestDataarcQueryKey(t *testing.T) {
  35. convey.Convey("arcQueryKey", t, func(ctx convey.C) {
  36. var (
  37. id = int64(0)
  38. dt = ""
  39. cp = int(0)
  40. )
  41. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  42. p1 := arcQueryKey(id, dt, cp)
  43. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  44. ctx.So(p1, convey.ShouldNotBeNil)
  45. })
  46. })
  47. })
  48. }
  49. func TestDataUpFansAnalysis(t *testing.T) {
  50. convey.Convey("UpFansAnalysis", t, func(ctx convey.C) {
  51. var (
  52. c = context.Background()
  53. mid = int64(0)
  54. ty = int(0)
  55. )
  56. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  57. res, err := d.UpFansAnalysis(c, mid, ty)
  58. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  59. ctx.So(err, convey.ShouldNotBeNil)
  60. ctx.So(res, convey.ShouldNotBeNil)
  61. })
  62. })
  63. })
  64. }
  65. func TestDataUpArcQuery(t *testing.T) {
  66. convey.Convey("UpArcQuery", t, func(ctx convey.C) {
  67. var (
  68. c = context.Background()
  69. mid = int64(0)
  70. dt = ""
  71. cp = int(0)
  72. )
  73. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  74. res, err := d.UpArcQuery(c, mid, dt, cp)
  75. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  76. ctx.So(err, convey.ShouldNotBeNil)
  77. ctx.So(res, convey.ShouldBeNil)
  78. })
  79. })
  80. })
  81. }