a bit more testing
This commit is contained in:
@@ -10,15 +10,28 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestParseResultValue(t *testing.T) {
|
||||
func TestParseValue(t *testing.T) {
|
||||
dbResult := repository.ListResultValuesByIDRow{
|
||||
ID: pgtype.UUID{},
|
||||
Queryid: pgtype.UUID{},
|
||||
Value: "",
|
||||
}
|
||||
|
||||
value := result.ParseResultValue(dbResult)
|
||||
value := result.ParseValue(&dbResult)
|
||||
assert.Equal(t, dbResult.Value, value.Value)
|
||||
assert.Equal(t, uuid.Nil, value.ID)
|
||||
assert.Equal(t, uuid.Nil, value.QueryID)
|
||||
}
|
||||
|
||||
func TestParseResultValue(t *testing.T) {
|
||||
dbResult := repository.ListResultsByDocumentIDRow{
|
||||
ID: pgtype.UUID{},
|
||||
Queryid: pgtype.UUID{},
|
||||
Queryversion: int32(1),
|
||||
}
|
||||
|
||||
value := result.Parse(&dbResult)
|
||||
assert.Equal(t, dbResult.Queryversion, value.QueryVersion)
|
||||
assert.Equal(t, uuid.Nil, value.ID)
|
||||
assert.Equal(t, uuid.Nil, value.QueryID)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user