fav_test.go 930 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package service
  2. import (
  3. "context"
  4. "testing"
  5. . "github.com/smartystreets/goconvey/convey"
  6. )
  7. func Test_setRelationCache(t *testing.T) {
  8. Convey("setRelationCache", t, func() {
  9. var (
  10. typ int8 = 2
  11. mid int64 = 88888894
  12. fid int64 = 289
  13. )
  14. err := s.setRelationCache(context.TODO(), typ, mid, fid)
  15. t.Logf("err:%v", err)
  16. So(err, ShouldBeNil)
  17. })
  18. }
  19. func Test_folder(t *testing.T) {
  20. Convey("folder", t, func() {
  21. var (
  22. typ int8 = 1
  23. mid int64 = 88888894
  24. fid int64 = 1
  25. )
  26. res, err := s.folder(context.TODO(), typ, mid, fid)
  27. t.Logf("res:%v", res)
  28. t.Logf("err:%v", err)
  29. So(res, ShouldNotBeNil)
  30. So(err, ShouldBeNil)
  31. })
  32. }
  33. func Test_addCoin(t *testing.T) {
  34. Convey("addMoney", t, func() {
  35. var (
  36. isAdd = true
  37. count = 200
  38. typ int8 = 1
  39. oid int64 = 123
  40. )
  41. err := s.addCoin(context.TODO(), isAdd, count, typ, oid)
  42. t.Logf("err:%v", err)
  43. So(err, ShouldBeNil)
  44. })
  45. }