Debian Codegraph @

v2/sarif/artifact_content_test.go

raw
1 package sarif
2
3 import (
4 "testing"
5
6 "github.com/stretchr/testify/assert"
7 )
8
9 func Test_create_artifact_content(t *testing.T) {
10 ac := NewArtifactContent()
11 ac.WithText("artifact body").
12 WithBinary("broken.exe").
13 WithRendered(NewMultiformatMessageString("mms string content"))
14
15 assert.Equal(t, `{"text":"artifact body","binary":"broken.exe","rendered":{"text":"mms string content"}}`, getJsonString(ac))
16 }