coin_test.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package service
  2. import (
  3. "context"
  4. "testing"
  5. "time"
  6. "go-common/app/interface/main/web/model"
  7. . "github.com/smartystreets/goconvey/convey"
  8. )
  9. func TestService_Coins(t *testing.T) {
  10. Convey("test coin Coins", t, WithService(func(s *Service) {
  11. var (
  12. mid int64 = 27515256
  13. aid int64 = 37515257
  14. )
  15. res, err := s.Coins(context.Background(), mid, aid)
  16. So(err, ShouldBeNil)
  17. So(res, ShouldNotBeNil)
  18. }))
  19. }
  20. func TestService_AddCoin(t *testing.T) {
  21. Convey("test coin AddCoin", t, WithService(func(s *Service) {
  22. var (
  23. mid int64 = 27515256
  24. aid int64 = 37515257
  25. upID int64 = 37515257
  26. multiply int64 = 1
  27. avtype int64 = 1
  28. business = model.CoinArcBusiness
  29. selectLike = 1
  30. )
  31. like, err := s.AddCoin(context.Background(), aid, mid, upID, multiply, avtype, business, "", "", "", time.Now(), selectLike)
  32. So(err, ShouldBeNil)
  33. So(like, ShouldNotBeNil)
  34. }))
  35. }
  36. func TestService_CoinExp(t *testing.T) {
  37. Convey("test coin CoinExp", t, WithService(func(s *Service) {
  38. var (
  39. mid int64 = 27515256
  40. )
  41. res, err := s.CoinExp(context.Background(), mid)
  42. So(err, ShouldBeNil)
  43. So(res, ShouldNotBeNil)
  44. }))
  45. }