19 lines
343 B
Go
19 lines
343 B
Go
package database_test
|
|
|
|
import (
|
|
"queryorchestration/internal/database"
|
|
"testing"
|
|
|
|
"github.com/google/uuid"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestMustToDBUUID(t *testing.T) {
|
|
id := uuid.New()
|
|
|
|
dbID := database.MustToDBUUID(id)
|
|
|
|
assert.Equal(t, true, dbID.Valid)
|
|
assert.Equal(t, id.String(), uuid.UUID(dbID.Bytes).String())
|
|
}
|