v2/sarif/artifact_location_test.go
raw| 1 | package sarif |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "github.com/stretchr/testify/assert" |
| 7 | ) |
| 8 | |
| 9 | func Test_create_new_artifact_location(t *testing.T) { |
| 10 | al := NewArtifactLocation(). |
| 11 | WithIndex(0). |
| 12 | WithUri("file://broken.go"). |
| 13 | WithUriBaseId("baseId"). |
| 14 | WithDescription(NewMessage().WithText("message text")) |
| 15 | |
| 16 | assert.Equal(t, `{"uri":"file://broken.go","uriBaseId":"baseId","index":0,"description":{"text":"message text"}}`, getJsonString(al)) |
| 17 | } |