feat: user buy media
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
"backend/providers/postgres"
|
||||
"backend/providers/storage"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
"github.com/stretchr/testify/suite"
|
||||
"go.uber.org/dig"
|
||||
@@ -27,6 +28,7 @@ type ServiceTestSuite struct {
|
||||
}
|
||||
|
||||
func Test_DiscoverMedias(t *testing.T) {
|
||||
log.SetLevel(log.DebugLevel)
|
||||
providers := testx.Default(
|
||||
postgres.DefaultProvider(),
|
||||
storage.DefaultProvider(),
|
||||
@@ -66,3 +68,18 @@ func (t *ServiceTestSuite) Test_getMediaByHash() {
|
||||
So(ext, ShouldEqual, "ts")
|
||||
})
|
||||
}
|
||||
|
||||
func (t *ServiceTestSuite) Test_GetUserBalance() {
|
||||
Convey("Test_GetUserBalance", t.T(), func() {
|
||||
balance, err := t.Svc.GetUserBalance(context.Background(), 1, 1)
|
||||
So(err, ShouldBeNil)
|
||||
t.T().Logf("balance: %+v", balance)
|
||||
})
|
||||
}
|
||||
|
||||
func (t *ServiceTestSuite) Test_Checkout() {
|
||||
Convey("Test_Checkout", t.T(), func() {
|
||||
err := t.Svc.Checkout(context.TODO(), 1, 1, 1)
|
||||
So(err, ShouldBeNil)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user