| 1 | package sarif |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "github.com/stretchr/testify/assert" |
| 7 | ) |
| 8 | |
| 9 | func Test_create_multi_format_message_string(t *testing.T) { |
| 10 | |
| 11 | msg := NewMultiformatMessageString("mock plain text") |
| 12 | |
| 13 | assert.Equal(t, `{"text":"mock plain text"}`, getJsonString(msg)) |
| 14 | } |
| 15 | |
| 16 | func Test_create_multi_format_message_string_with_markdown(t *testing.T) { |
| 17 | |
| 18 | msg := NewMultiformatMessageString("mock plain text"). |
| 19 | WithMarkdown("mock markdown text") |
| 20 | |
| 21 | assert.Equal(t, `{"text":"mock plain text","markdown":"mock markdown text"}`, getJsonString(msg)) |
| 22 | } |