channel_tab_test.go 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. package show
  2. import (
  3. "testing"
  4. "go-common/app/admin/main/feed/model/show"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestShowChannelTabAdd(t *testing.T) {
  8. convey.Convey("ChannelTabAdd", t, func(ctx convey.C) {
  9. var (
  10. param = &show.ChannelTabAP{}
  11. )
  12. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  13. err := d.ChannelTabAdd(param)
  14. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  15. ctx.So(err, convey.ShouldBeNil)
  16. })
  17. })
  18. })
  19. }
  20. func TestShowChannelTabUpdate(t *testing.T) {
  21. convey.Convey("ChannelTabUpdate", t, func(ctx convey.C) {
  22. var (
  23. param = &show.ChannelTabUP{}
  24. )
  25. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  26. err := d.ChannelTabUpdate(param)
  27. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  28. ctx.So(err, convey.ShouldBeNil)
  29. })
  30. })
  31. })
  32. }
  33. func TestShowChannelTabDelete(t *testing.T) {
  34. convey.Convey("ChannelTabDelete", t, func(ctx convey.C) {
  35. var (
  36. id = int64(0)
  37. )
  38. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  39. err := d.ChannelTabDelete(id)
  40. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  41. ctx.So(err, convey.ShouldBeNil)
  42. })
  43. })
  44. })
  45. }
  46. func TestShowChannelTabValid(t *testing.T) {
  47. convey.Convey("ChannelTabValid", t, func(ctx convey.C) {
  48. var (
  49. id = int64(0)
  50. tagID = int64(0)
  51. sTime = int64(0)
  52. eTime = int64(0)
  53. priority = int(0)
  54. )
  55. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  56. count, err := d.ChannelTabValid(id, tagID, sTime, eTime, priority)
  57. ctx.Convey("Then err should be nil.count should not be nil.", func(ctx convey.C) {
  58. ctx.So(err, convey.ShouldBeNil)
  59. ctx.So(count, convey.ShouldNotBeNil)
  60. })
  61. })
  62. })
  63. }