71f9802e1a
Split Query Running + Debugging Full Flow * completedquerysyncrunner * spliitinglogic * synccomplete * informdependents * only push same collector * deps * livetesting * foundissue * some issues resolved * activeupdate * collectorupdatefixes * fix dbquesries * tests * tests * pollingdebug
44 lines
1.0 KiB
Go
44 lines
1.0 KiB
Go
package document_test
|
|
|
|
import (
|
|
"queryorchestration/internal/document"
|
|
"queryorchestration/internal/serviceconfig"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestIsValidCleanVersion(t *testing.T) {
|
|
cfg := &serviceconfig.BaseConfig{}
|
|
svc := document.New(cfg)
|
|
|
|
assert.Nil(t, svc.IsValidCleanVersion(1))
|
|
assert.Error(t, svc.IsValidCleanVersion(2))
|
|
assert.Error(t, svc.IsValidCleanVersion(0))
|
|
assert.Error(t, svc.IsValidCleanVersion(-1))
|
|
}
|
|
|
|
func TestIsValidTextVersion(t *testing.T) {
|
|
cfg := &serviceconfig.BaseConfig{}
|
|
svc := document.New(cfg)
|
|
|
|
assert.Nil(t, svc.IsValidTextVersion(1))
|
|
assert.Error(t, svc.IsValidTextVersion(2))
|
|
assert.Error(t, svc.IsValidTextVersion(0))
|
|
assert.Error(t, svc.IsValidTextVersion(-1))
|
|
}
|
|
|
|
func TestGetCleanVersion(t *testing.T) {
|
|
cfg := &serviceconfig.BaseConfig{}
|
|
svc := document.New(cfg)
|
|
|
|
assert.Equal(t, int32(1), svc.GetCleanVersion())
|
|
}
|
|
|
|
func TestGetTextVersion(t *testing.T) {
|
|
cfg := &serviceconfig.BaseConfig{}
|
|
svc := document.New(cfg)
|
|
|
|
assert.Equal(t, int32(1), svc.GetTextVersion())
|
|
}
|