19 lines
290 B
Go
19 lines
290 B
Go
|
|
package database_test
|
||
|
|
|
||
|
|
import (
|
||
|
|
"gotemplate/internal/database"
|
||
|
|
"testing"
|
||
|
|
|
||
|
|
"github.com/google/uuid"
|
||
|
|
"github.com/stretchr/testify/assert"
|
||
|
|
)
|
||
|
|
|
||
|
|
func TestToDBUUID(t *testing.T) {
|
||
|
|
id := uuid.New()
|
||
|
|
|
||
|
|
dbID, err := database.ToDBUUID(id)
|
||
|
|
|
||
|
|
assert.Nil(t, err)
|
||
|
|
assert.Equal(t, true, dbID.Valid)
|
||
|
|
}
|