mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-10 22:17:44 +00:00
f9b9c595cf
* some tests * more tests * tidy up go.mod * more tests * add postgres * beep * again * Set up schema * fix device test
33 lines
664 B
Go
33 lines
664 B
Go
package repository_test
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/christianselig/apollo-backend/internal/domain"
|
|
"github.com/christianselig/apollo-backend/internal/repository"
|
|
"github.com/christianselig/apollo-backend/internal/testhelper"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func NewTestPostgresWatcher(t *testing.T) domain.WatcherRepository {
|
|
t.Helper()
|
|
|
|
ctx := context.Background()
|
|
conn := testhelper.NewTestPgxConn(t)
|
|
|
|
tx, err := conn.Begin(ctx)
|
|
require.NoError(t, err)
|
|
|
|
repo := repository.NewPostgresWatcher(tx)
|
|
|
|
t.Cleanup(func() {
|
|
_ = tx.Rollback(ctx)
|
|
})
|
|
|
|
return repo
|
|
}
|
|
|
|
func TestPostgresWatcher_GetByID(t *testing.T) {
|
|
t.Parallel()
|
|
}
|