-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e35512a
commit fa1b327
Showing
3 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package annotator | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestGetSchemaMetadata(t *testing.T) { | ||
testData := []struct { | ||
name string | ||
input []byte | ||
expected schemaMetadata | ||
}{ | ||
{ | ||
name: "Valid JSON", | ||
input: []byte(`{"self":{"vendor":"testVendor","namespace":"testNamespace","version":"testVersion"},"disableValidation":true}`), | ||
expected: schemaMetadata{ | ||
Vendor: "testVendor", | ||
Namespace: "testNamespace", | ||
Version: "testVersion", | ||
DisableValidation: true, | ||
}, | ||
}, | ||
} | ||
|
||
for _, tc := range testData { | ||
t.Run(tc.name, func(t *testing.T) { | ||
result := getSchemaMetadata(tc.input) | ||
assert.Equal(t, tc.expected, result) | ||
}) | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.