err_msg_test.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. package cms
  2. import (
  3. "go-common/app/interface/main/tv/model"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestCmsauthMsg(t *testing.T) {
  8. var (
  9. cond = ""
  10. )
  11. convey.Convey("authMsg", t, func(ctx convey.C) {
  12. msg := d.authMsg(cond)
  13. ctx.Convey("Then msg should not be nil.", func(ctx convey.C) {
  14. ctx.So(msg, convey.ShouldNotBeNil)
  15. })
  16. })
  17. }
  18. func TestCmsSnErrMsg(t *testing.T) {
  19. var (
  20. season = &model.SnAuth{}
  21. )
  22. convey.Convey("SnErrMsg", t, func(ctx convey.C) {
  23. p1, p2 := d.SnErrMsg(season)
  24. ctx.Convey("Then p1,p2 should not be nil.", func(ctx convey.C) {
  25. ctx.So(p2, convey.ShouldNotBeNil)
  26. ctx.So(p1, convey.ShouldNotBeNil)
  27. })
  28. })
  29. }
  30. func TestCmsUgcErrMsg(t *testing.T) {
  31. var (
  32. deleted = int(0)
  33. result = int(0)
  34. valid = int(0)
  35. )
  36. convey.Convey("UgcErrMsg", t, func(ctx convey.C) {
  37. p1, p2 := d.UgcErrMsg(deleted, result, valid)
  38. ctx.Convey("Then p1,p2 should not be nil.", func(ctx convey.C) {
  39. ctx.So(p2, convey.ShouldNotBeNil)
  40. ctx.So(p1, convey.ShouldNotBeNil)
  41. })
  42. })
  43. }
  44. func TestCmsAuditingMsg(t *testing.T) {
  45. convey.Convey("AuditingMsg", t, func(ctx convey.C) {
  46. p1, p2 := d.AuditingMsg()
  47. ctx.Convey("Then p1,p2 should not be nil.", func(ctx convey.C) {
  48. ctx.So(p2, convey.ShouldNotBeNil)
  49. ctx.So(p1, convey.ShouldNotBeNil)
  50. })
  51. })
  52. }
  53. func TestCmsEpErrMsg(t *testing.T) {
  54. var (
  55. ep = &model.EpAuth{}
  56. )
  57. convey.Convey("EpErrMsg", t, func(ctx convey.C) {
  58. p1, p2 := d.EpErrMsg(ep)
  59. ctx.Convey("Then p1,p2 should not be nil.", func(ctx convey.C) {
  60. ctx.So(p2, convey.ShouldNotBeNil)
  61. ctx.So(p1, convey.ShouldNotBeNil)
  62. })
  63. })
  64. }