File: multi_format_message_string_test.go

package info (click to toggle)
golang-github-owenrumney-go-sarif 2.3.3-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 712 kB
  • sloc: makefile: 13
file content (22 lines) | stat: -rw-r--r-- 536 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package sarif

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func Test_create_multi_format_message_string(t *testing.T) {

	msg := NewMultiformatMessageString("mock plain text")

	assert.Equal(t, `{"text":"mock plain text"}`, getJsonString(msg))
}

func Test_create_multi_format_message_string_with_markdown(t *testing.T) {

	msg := NewMultiformatMessageString("mock plain text").
		WithMarkdown("mock markdown text")

	assert.Equal(t, `{"text":"mock plain text","markdown":"mock markdown text"}`, getJsonString(msg))
}