moretesting
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package document_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"gotemplate/internal/database/repository"
|
||||
"gotemplate/internal/query"
|
||||
"testing"
|
||||
|
||||
"github.com/pashagolub/pgxmock/v3"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestService(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
db, err := pgxmock.NewConn()
|
||||
if err != nil {
|
||||
t.Fatalf("failed to open pgxmock database: %v", err)
|
||||
}
|
||||
defer db.Close(ctx)
|
||||
|
||||
queries := repository.New(db)
|
||||
svc := query.New(queries)
|
||||
assert.NotNil(t, svc)
|
||||
}
|
||||
Reference in New Issue
Block a user