duplicate_test.go 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoUserTelDuplicate(t *testing.T) {
  8. convey.Convey("UserTelDuplicate", t, func(ctx convey.C) {
  9. var (
  10. c = context.Background()
  11. )
  12. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  13. res, err := d.UserTelDuplicate(c)
  14. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  15. ctx.So(err, convey.ShouldBeNil)
  16. ctx.So(res, convey.ShouldBeNil)
  17. })
  18. })
  19. })
  20. }
  21. func TestDaoUserEmailDuplicate(t *testing.T) {
  22. convey.Convey("UserEmailDuplicate", t, func(ctx convey.C) {
  23. var (
  24. c = context.Background()
  25. )
  26. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  27. res, err := d.UserEmailDuplicate(c)
  28. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  29. ctx.So(err, convey.ShouldBeNil)
  30. ctx.So(res, convey.ShouldBeNil)
  31. })
  32. })
  33. })
  34. }
  35. func TestDaoUpdateUserTelDuplicateStatus(t *testing.T) {
  36. convey.Convey("UpdateUserTelDuplicateStatus", t, func(ctx convey.C) {
  37. var (
  38. c = context.Background()
  39. id = int64(0)
  40. )
  41. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  42. affected, err := d.UpdateUserTelDuplicateStatus(c, id)
  43. ctx.Convey("Then err should be nil.affected should not be nil.", func(ctx convey.C) {
  44. ctx.So(err, convey.ShouldBeNil)
  45. ctx.So(affected, convey.ShouldNotBeNil)
  46. })
  47. })
  48. })
  49. }
  50. func TestDaoUpdateUserEmailDuplicateStatus(t *testing.T) {
  51. convey.Convey("UpdateUserEmailDuplicateStatus", t, func(ctx convey.C) {
  52. var (
  53. c = context.Background()
  54. id = int64(0)
  55. )
  56. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  57. affected, err := d.UpdateUserEmailDuplicateStatus(c, id)
  58. ctx.Convey("Then err should be nil.affected should not be nil.", func(ctx convey.C) {
  59. ctx.So(err, convey.ShouldBeNil)
  60. ctx.So(affected, convey.ShouldNotBeNil)
  61. })
  62. })
  63. })
  64. }