44 lines
831 B
Go
44 lines
831 B
Go
package models
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"quyun/app/service/testx"
|
|
"quyun/database"
|
|
"quyun/database/schemas/public/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 UsersInjectParams struct {
|
|
dig.In
|
|
Initials []contracts.Initial `group:"initials"`
|
|
}
|
|
|
|
type UsersTestSuite struct {
|
|
suite.Suite
|
|
|
|
UsersInjectParams
|
|
}
|
|
|
|
func Test_Users(t *testing.T) {
|
|
providers := testx.Default().With(Provide)
|
|
testx.Serve(providers, t, func(params UsersInjectParams) {
|
|
suite.Run(t, &UsersTestSuite{
|
|
UsersInjectParams: params,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (s *UsersTestSuite) Test_Demo() {
|
|
Convey("Test_Demo", s.T(), func() {
|
|
database.Truncate(context.Background(), db, table.Users.TableName())
|
|
})
|
|
}
|