mc_special_test.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package dao
  2. import (
  3. "context"
  4. "go-common/app/job/main/dm2/model"
  5. "testing"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestDaospecialDmKey(t *testing.T) {
  9. convey.Convey("specialDmKey", t, func(ctx convey.C) {
  10. var (
  11. oid = int64(0)
  12. tp = int32(0)
  13. )
  14. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  15. p1 := testDao.specialDmKey(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 TestDaoDelSpecialDmCache(t *testing.T) {
  23. convey.Convey("DelSpecialDmCache", t, func(ctx convey.C) {
  24. var (
  25. c = context.Background()
  26. oid = int64(0)
  27. tp = int32(0)
  28. )
  29. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  30. testDao.DelSpecialDmCache(c, oid, tp)
  31. })
  32. })
  33. }
  34. func TestDaoAddSpecialDmCache(t *testing.T) {
  35. convey.Convey("AddSpecialDmCache", t, func(ctx convey.C) {
  36. var (
  37. c = context.Background()
  38. ds = &model.DmSpecial{}
  39. )
  40. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  41. err := testDao.AddSpecialDmCache(c, ds)
  42. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  43. ctx.So(err, convey.ShouldBeNil)
  44. })
  45. })
  46. })
  47. }