account_test.go 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoTelRiskLevel(t *testing.T) {
  8. convey.Convey("TelRiskLevel", t, func(ctx convey.C) {
  9. var (
  10. c = context.Background()
  11. mid = int64(1)
  12. )
  13. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  14. riskLevel, err := d.TelRiskLevel(c, mid)
  15. ctx.Convey("Then err should be nil.riskLevel should not be nil.", func(ctx convey.C) {
  16. ctx.So(err, convey.ShouldBeNil)
  17. ctx.So(riskLevel, convey.ShouldNotBeNil)
  18. })
  19. })
  20. })
  21. }
  22. func TestDaoBlockAccount(t *testing.T) {
  23. convey.Convey("BlockAccount", t, func(ctx convey.C) {
  24. var (
  25. c = context.Background()
  26. mid = int64(1)
  27. )
  28. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  29. err := d.BlockAccount(c, mid)
  30. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  31. ctx.So(err, convey.ShouldNotBeNil)
  32. })
  33. })
  34. })
  35. }
  36. func TestDaoSecurityLogin(t *testing.T) {
  37. convey.Convey("SecurityLogin", t, func(ctx convey.C) {
  38. var (
  39. c = context.Background()
  40. mid = int64(1)
  41. reason = "unit test"
  42. )
  43. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  44. err := d.SecurityLogin(c, mid, reason)
  45. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  46. ctx.So(err, convey.ShouldBeNil)
  47. })
  48. })
  49. })
  50. }
  51. func TestDaoTelInfo(t *testing.T) {
  52. convey.Convey("TelInfo", t, func(ctx convey.C) {
  53. var (
  54. c = context.Background()
  55. mid = int64(1)
  56. )
  57. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  58. tel, err := d.TelInfo(c, mid)
  59. ctx.Convey("Then err should be nil.tel should not be nil.", func(ctx convey.C) {
  60. ctx.So(err, convey.ShouldBeNil)
  61. ctx.So(tel, convey.ShouldNotBeNil)
  62. })
  63. })
  64. })
  65. }
  66. func TestProfileInfo(t *testing.T) {
  67. convey.Convey("ProfileInfo", t, func(ctx convey.C) {
  68. var (
  69. c = context.Background()
  70. mid = int64(1)
  71. )
  72. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  73. tel, err := d.ProfileInfo(c, mid, "")
  74. ctx.Convey("Then err should be nil.tel should not be nil.", func(ctx convey.C) {
  75. ctx.So(err, convey.ShouldBeNil)
  76. ctx.So(tel, convey.ShouldNotBeNil)
  77. })
  78. })
  79. })
  80. }