Debian Codegraph @

v2/sarif/location_relationship_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_location_relationship(t *testing.T) {
10 l := NewLocationRelationship(1).
11 WithDescription(
12 NewMessage().
13 WithMarkdown("# markdown text"),
14 ).
15 WithKinds([]string{"kind", "another kind"})
16
17 assert.Equal(t, `{"target":1,"kinds":["kind","another kind"],"description":{"markdown":"# markdown text"}}`, getJsonString(l))
18 }