search_test.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "time"
  6. "go-common/app/admin/main/member/model"
  7. "github.com/smartystreets/goconvey/convey"
  8. )
  9. func TestDaoSearchMember(t *testing.T) {
  10. convey.Convey("SearchMember", t, func() {
  11. result, err := d.SearchMember(context.Background(), &model.ArgList{Mid: 627272, PN: 1, PS: 10})
  12. convey.So(err, convey.ShouldBeNil)
  13. convey.So(result, convey.ShouldNotBeNil)
  14. })
  15. }
  16. func TestSearchLog(t *testing.T) {
  17. convey.Convey("SearchLog", t, func() {
  18. result, err := d.SearchLog(context.Background(), 1164, 0, "", "")
  19. convey.So(err, convey.ShouldBeNil)
  20. convey.So(result, convey.ShouldNotBeNil)
  21. })
  22. }
  23. func TestDao_SearchFaceCheckRes(t *testing.T) {
  24. convey.Convey("SearchFaceCheckRes", t, func() {
  25. result, err := d.SearchFaceCheckRes(context.Background(), "2879cd5fb8518f7c6da75887994c1b2a7fe670bd.png")
  26. convey.So(err, convey.ShouldBeNil)
  27. convey.So(result, convey.ShouldNotBeNil)
  28. })
  29. }
  30. func TestDao_SearchUserAuditLog(t *testing.T) {
  31. convey.Convey("SearchUserAuditLog", t, func() {
  32. result, err := d.SearchUserAuditLog(context.Background(), 1164)
  33. convey.So(err, convey.ShouldBeNil)
  34. convey.So(result, convey.ShouldNotBeNil)
  35. })
  36. }
  37. func TestDao_SearchUserPropertyReview(t *testing.T) {
  38. convey.Convey("SearchFaceCheckRes", t, func() {
  39. etime := time.Now().Format("2006-01-02 15:04:05")
  40. stime := time.Now().AddDate(0, 0, -26).Format("2006-01-02 15:04:05")
  41. result, err := d.SearchUserPropertyReview(context.Background(), 0, []int{1}, []int{1, 2}, false, false, "", stime, etime, 1, 10)
  42. convey.So(err, convey.ShouldBeNil)
  43. convey.So(result, convey.ShouldNotBeNil)
  44. })
  45. }