apollo-backend/internal/repository/postgres_watcher_test.go
André Medeiros f9b9c595cf Better testing (#62)
* some tests

* more tests

* tidy up go.mod

* more tests

* add postgres

* beep

* again

* Set up schema

* fix device test
2022-05-07 12:37:21 -04:00

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()
}