mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
23 lines
439 B
Go
23 lines
439 B
Go
package common
|
|
|
|
import (
|
|
"github.com/stretchr/testify/assert"
|
|
"testing"
|
|
)
|
|
|
|
// Verify that you can connect to the database
|
|
func TestDBConnection(t *testing.T) {
|
|
db := InitDB()
|
|
defer db.Close()
|
|
|
|
assert.NoError(t, VerifyConnection(db), "DB must ping")
|
|
}
|
|
|
|
// Verify that the associations between every model are done properly
|
|
func TestDummyDB(t *testing.T) {
|
|
test_db := DummyInitDB()
|
|
defer test_db.Close()
|
|
|
|
DummyPopulateDB(test_db)
|
|
|
|
}
|