moretesting

This commit is contained in:
Michael McGuinness
2024-12-23 18:13:57 +00:00
parent 1a5fab87c6
commit eb917fb25e
10 changed files with 245 additions and 40 deletions
+25
View File
@@ -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)
}