dao.cache_test.go 2.2 KB

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