Merged in feature/testquery (pull request #39)

Test Query

* depstextandclean

* startedcleaningresult

* resulttidyup

* roundone

* cleaning

* unsyncedquery

* startedtestsandsimplification

* api

* querytests

* resultprocessortests

* unittests

* cleanup
This commit is contained in:
Michael McGuinness
2025-01-29 11:52:37 +00:00
parent c36b0cdcf8
commit 0ac5ff9e15
109 changed files with 2804 additions and 2100 deletions
+32
View File
@@ -0,0 +1,32 @@
package documenttext
import (
"errors"
"github.com/google/uuid"
)
type Service struct {
}
func New() *Service {
return &Service{}
}
func (s *Service) IsValidVersion(v int32) error {
if v <= 0 {
return errors.New("document clean code version must be > 0")
}
return nil
}
type IsExtractedParams struct {
DocumentID uuid.UUID
MinCleanVersion int32
MinTextVersion int32
}
func (s *Service) IsExtracted(params *IsExtractedParams) error {
return nil
}
+31
View File
@@ -0,0 +1,31 @@
package documenttext_test
import (
documenttext "queryorchestration/internal/document/text"
"testing"
"github.com/google/uuid"
"github.com/stretchr/testify/assert"
)
func TestService(t *testing.T) {
svc := documenttext.New()
assert.NotNil(t, svc)
}
func TestIsValidVersion(t *testing.T) {
svc := documenttext.New()
assert.Nil(t, svc.IsValidVersion(2))
assert.Error(t, svc.IsValidVersion(-1))
}
func TestIsExtracted(t *testing.T) {
svc := documenttext.New()
assert.Nil(t, svc.IsExtracted(&documenttext.IsExtractedParams{
DocumentID: uuid.New(),
MinCleanVersion: int32(1),
MinTextVersion: int32(1),
}))
}