2025-01-07 16:30:45 +00:00
|
|
|
package result_test
|
2024-12-23 18:13:57 +00:00
|
|
|
|
|
|
|
|
import (
|
2024-12-24 17:13:48 +00:00
|
|
|
"queryorchestration/internal/database/repository"
|
2025-01-17 12:00:32 +00:00
|
|
|
"queryorchestration/internal/query/result"
|
2024-12-23 18:13:57 +00:00
|
|
|
"testing"
|
|
|
|
|
|
|
|
|
|
"github.com/google/uuid"
|
|
|
|
|
"github.com/jackc/pgx/v5/pgtype"
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
|
)
|
|
|
|
|
|
2024-12-24 12:47:40 +00:00
|
|
|
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)
|
|
|
|
|
}
|