Working on building out models

a recursive approach? or a dfs approach? not sure yet. still playing with ideas.
This commit is contained in:
Dave Shanley
2022-07-29 09:44:37 -04:00
parent a906d46227
commit eda834f79f
9 changed files with 210 additions and 3 deletions

View File

@@ -0,0 +1,22 @@
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/petstorev3.json")
assert.NoError(t, aErr)
doc, err := CreateDocument(data)
assert.NotNil(t, doc)
assert.NoError(t, err)
}