mc_wave_form_test.go 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. package dao
  2. import (
  3. "context"
  4. "go-common/app/interface/main/dm2/model"
  5. "testing"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestDaowaveFormKey(t *testing.T) {
  9. convey.Convey("waveFormKey", t, func(ctx convey.C) {
  10. var (
  11. oid = int64(0)
  12. tp = int32(0)
  13. )
  14. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  15. p1 := testDao.waveFormKey(oid, tp)
  16. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  17. ctx.So(p1, convey.ShouldNotBeNil)
  18. })
  19. })
  20. })
  21. }
  22. func TestDaoSetWaveFormCache(t *testing.T) {
  23. convey.Convey("SetWaveFormCache", t, func(ctx convey.C) {
  24. var (
  25. c = context.Background()
  26. waveForm = &model.WaveForm{}
  27. )
  28. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  29. err := testDao.SetWaveFormCache(c, waveForm)
  30. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  31. ctx.So(err, convey.ShouldBeNil)
  32. })
  33. })
  34. })
  35. }
  36. func TestDaoWaveFormCache(t *testing.T) {
  37. convey.Convey("WaveFormCache", t, func(ctx convey.C) {
  38. var (
  39. c = context.Background()
  40. oid = int64(0)
  41. tp = int32(0)
  42. )
  43. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  44. waveForm, err := testDao.WaveFormCache(c, oid, tp)
  45. ctx.Convey("Then err should be nil.waveForm should not be nil.", func(ctx convey.C) {
  46. ctx.So(err, convey.ShouldBeNil)
  47. ctx.So(waveForm, convey.ShouldNotBeNil)
  48. })
  49. })
  50. })
  51. }
  52. func TestDaoDelWaveFormCache(t *testing.T) {
  53. convey.Convey("DelWaveFormCache", t, func(ctx convey.C) {
  54. var (
  55. c = context.Background()
  56. oid = int64(0)
  57. tp = int32(0)
  58. )
  59. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  60. err := testDao.DelWaveFormCache(c, oid, tp)
  61. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  62. ctx.So(err, convey.ShouldBeNil)
  63. })
  64. })
  65. })
  66. }