Files
libopenapi/openapi/create_document_test.go
Dave Shanley 7535cf568c Working through the model builder
Shaping out the design as I go, what makes sence, what feels right, what do we need, how do we want to use it and how to we want to search it etc.
2022-07-30 15:27:21 -04:00

23 lines
470 B
Go

package openapi
import (
"github.com/stretchr/testify/assert"
"io/ioutil"
"testing"
)
func TestCreateDocument_NoData(t *testing.T) {
doc, err := CreateDocument(nil)
assert.Nil(t, doc)
assert.Error(t, err)
}
func TestCreateDocument(t *testing.T) {
data, aErr := ioutil.ReadFile("../test_specs/burgershop.openapi.yaml")
assert.NoError(t, aErr)
doc, err := CreateDocument(data)
assert.NotNil(t, doc)
assert.NoError(t, err)
}