match_test.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package like
  2. import (
  3. "context"
  4. "testing"
  5. "fmt"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestLikeUnDoMatchUsers(t *testing.T) {
  9. convey.Convey("UnDoMatchUsers", t, func(ctx convey.C) {
  10. var (
  11. c = context.Background()
  12. matchObjID = int64(1)
  13. limit = int(10)
  14. )
  15. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  16. list, err := d.UnDoMatchUsers(c, matchObjID, limit)
  17. ctx.Convey("Then err should be nil.list should not be nil.", func(ctx convey.C) {
  18. ctx.So(err, convey.ShouldBeNil)
  19. fmt.Printf("%+v", list)
  20. })
  21. })
  22. })
  23. }
  24. func TestLikeUpMatchUserResult(t *testing.T) {
  25. convey.Convey("UpMatchUserResult", t, func(ctx convey.C) {
  26. var (
  27. c = context.Background()
  28. matchObjID = int64(1)
  29. mids = []int64{111}
  30. )
  31. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  32. err := d.UpMatchUserResult(c, matchObjID, mids)
  33. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  34. ctx.So(err, convey.ShouldBeNil)
  35. })
  36. })
  37. })
  38. }
  39. func TestLikeMatchObjInfo(t *testing.T) {
  40. convey.Convey("MatchObjInfo", t, func(ctx convey.C) {
  41. var (
  42. c = context.Background()
  43. matchObjID = int64(37)
  44. )
  45. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  46. data, err := d.MatchObjInfo(c, matchObjID)
  47. ctx.Convey("Then err should be nil.data should not be nil.", func(ctx convey.C) {
  48. ctx.So(err, convey.ShouldBeNil)
  49. ctx.So(data, convey.ShouldNotBeNil)
  50. })
  51. })
  52. })
  53. }