Files
query-orchestration/internal/test/assertions_test.go
T

30 lines
773 B
Go
Raw Normal View History

package test_test
import (
"strings"
"testing"
"queryorchestration/internal/test"
"github.com/aws/aws-sdk-go-v2/service/textract"
"github.com/stretchr/testify/assert"
)
func TestAssertStringToReader(t *testing.T) {
t.Run("pass", func(t *testing.T) {
mockT := &testing.T{}
test.AssertStringToReader(t, "hi", strings.NewReader("hi"))
assert.False(t, mockT.Failed())
})
t.Run("fail", func(t *testing.T) {
mockT := &testing.T{}
test.AssertStringToReader(mockT, "bye", strings.NewReader("hi"))
assert.True(t, mockT.Failed())
})
}
func TestGetTextractFileResponse(t *testing.T) {
out := test.GetTextractFileResponse(t, "../../assets/sampleGeneration/generated/helloWorld.gen")
assert.IsType(t, map[string][]textract.DetectDocumentTextOutput{}, out)
}