feat: update toolchain
This commit is contained in:
43
backend/app/model/user_posts_test.go
Normal file
43
backend/app/model/user_posts_test.go
Normal file
@@ -0,0 +1,43 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"quyun/app/service/testx"
|
||||
"quyun/database"
|
||||
"quyun/database/table"
|
||||
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
"go.ipao.vip/atom/contracts"
|
||||
|
||||
// . "github.com/go-jet/jet/v2/postgres"
|
||||
"github.com/stretchr/testify/suite"
|
||||
"go.uber.org/dig"
|
||||
)
|
||||
|
||||
type UserPostsInjectParams struct {
|
||||
dig.In
|
||||
Initials []contracts.Initial `group:"initials"`
|
||||
}
|
||||
|
||||
type UserPostsTestSuite struct {
|
||||
suite.Suite
|
||||
|
||||
UserPostsInjectParams
|
||||
}
|
||||
|
||||
func Test_UserPosts(t *testing.T) {
|
||||
providers := testx.Default().With(Provide)
|
||||
testx.Serve(providers, t, func(params UserPostsInjectParams) {
|
||||
suite.Run(t, &UserPostsTestSuite{
|
||||
UserPostsInjectParams: params,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
func (s *UserPostsTestSuite) Test_Demo() {
|
||||
Convey("Test_Demo", s.T(), func() {
|
||||
database.Truncate(context.Background(), db, table.UserPosts.TableName())
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user