rank_test.go 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. package dao
  2. import (
  3. "go-common/app/admin/ep/melloi/model"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoTreesQuery(t *testing.T) {
  8. convey.Convey("TreesQuery", t, func(convCtx convey.C) {
  9. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  10. res, err := d.TreesQuery()
  11. convCtx.Convey("Then err should be nil.res should not be nil.", func(convCtx convey.C) {
  12. convCtx.So(err, convey.ShouldBeNil)
  13. convCtx.So(res, convey.ShouldNotBeNil)
  14. })
  15. })
  16. })
  17. }
  18. func TestDaoTreeNumQuery(t *testing.T) {
  19. convey.Convey("TreeNumQuery", t, func(convCtx convey.C) {
  20. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  21. res, err := d.TreeNumQuery()
  22. convCtx.Convey("Then err should be nil.res should not be nil.", func(convCtx convey.C) {
  23. convCtx.So(err, convey.ShouldBeNil)
  24. convCtx.So(res, convey.ShouldNotBeNil)
  25. })
  26. })
  27. })
  28. }
  29. func TestDaoTopHttpQuery(t *testing.T) {
  30. convey.Convey("TopHttpQuery", t, func(convCtx convey.C) {
  31. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  32. res, err := d.TopHttpQuery()
  33. convCtx.Convey("Then err should be nil.res should not be nil.", func(convCtx convey.C) {
  34. convCtx.So(err, convey.ShouldBeNil)
  35. convCtx.So(res, convey.ShouldNotBeNil)
  36. })
  37. })
  38. })
  39. }
  40. func TestDaoTopGrpcQuery(t *testing.T) {
  41. convey.Convey("TopGrpcQuery", t, func(convCtx convey.C) {
  42. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  43. res, err := d.TopGrpcQuery()
  44. convCtx.Convey("Then err should be nil.res should not be nil.", func(convCtx convey.C) {
  45. convCtx.So(err, convey.ShouldBeNil)
  46. convCtx.So(res, convey.ShouldNotBeNil)
  47. })
  48. })
  49. })
  50. }
  51. func TestDaoTopSceneQuery(t *testing.T) {
  52. convey.Convey("TopSceneQuery", t, func(convCtx convey.C) {
  53. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  54. res, err := d.TopSceneQuery()
  55. convCtx.Convey("Then err should be nil.res should not be nil.", func(convCtx convey.C) {
  56. convCtx.So(err, convey.ShouldBeNil)
  57. convCtx.So(res, convey.ShouldNotBeNil)
  58. })
  59. })
  60. })
  61. }
  62. func TestDaoTopDeptQuery(t *testing.T) {
  63. convey.Convey("TopDeptQuery", t, func(convCtx convey.C) {
  64. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  65. res, err := d.TopDeptQuery()
  66. convCtx.Convey("Then err should be nil.res should not be nil.", func(convCtx convey.C) {
  67. convCtx.So(err, convey.ShouldBeNil)
  68. convCtx.So(res, convey.ShouldNotBeNil)
  69. })
  70. })
  71. })
  72. }
  73. func TestDaoBuildLineQuery(t *testing.T) {
  74. convey.Convey("BuildLineQuery", t, func(convCtx convey.C) {
  75. var (
  76. rank = &model.Rank{}
  77. summary = &model.ReportSummary{}
  78. )
  79. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  80. res, err := d.BuildLineQuery(rank, summary)
  81. convCtx.Convey("Then err should be nil.res should not be nil.", func(convCtx convey.C) {
  82. convCtx.So(err, convey.ShouldBeNil)
  83. convCtx.So(res, convey.ShouldNotBeNil)
  84. })
  85. })
  86. })
  87. }
  88. func TestDaoStateLineQuery(t *testing.T) {
  89. convey.Convey("StateLineQuery", t, func(convCtx convey.C) {
  90. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  91. res, err := d.StateLineQuery()
  92. convCtx.Convey("Then err should be nil.res should not be nil.", func(convCtx convey.C) {
  93. convCtx.So(err, convey.ShouldBeNil)
  94. convCtx.So(res, convey.ShouldNotBeNil)
  95. })
  96. })
  97. })
  98. }