mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-08 04:20:17 +00:00
added test for nill mock generator item
Signed-off-by: quobix <dave@quobix.com>
This commit is contained in:
@@ -96,6 +96,18 @@ func TestNewMockGeneratorWithDictionary(t *testing.T) {
|
|||||||
assert.NotNil(t, mg)
|
assert.NotNil(t, mg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestMockGenerator_GenerateJSONMock_NoObject(t *testing.T) {
|
||||||
|
|
||||||
|
mg := NewMockGenerator(JSON)
|
||||||
|
|
||||||
|
var isNil any
|
||||||
|
isNil = nil
|
||||||
|
|
||||||
|
mock, err := mg.GenerateMock(isNil, "")
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.Nil(t, mock)
|
||||||
|
}
|
||||||
|
|
||||||
func TestMockGenerator_GenerateJSONMock_BadObject(t *testing.T) {
|
func TestMockGenerator_GenerateJSONMock_BadObject(t *testing.T) {
|
||||||
type NotMockable struct {
|
type NotMockable struct {
|
||||||
pizza string
|
pizza string
|
||||||
|
|||||||
Reference in New Issue
Block a user