✨ 初始化项目
This commit is contained in:
23
markdown_test.go
Normal file
23
markdown_test.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package wxworkbot
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestMarkdownMessage(t *testing.T) {
|
||||
jsonString := `
|
||||
{
|
||||
"msgtype": "markdown",
|
||||
"markdown": {
|
||||
"content": "<font color=\"warning\">233</font>"
|
||||
}
|
||||
}`
|
||||
var markdownMsg markdownMessage
|
||||
err := json.Unmarshal([]byte(jsonString), &markdownMsg)
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, markdownMsg.MsgType, "markdown")
|
||||
assert.Equal(t, markdownMsg.Markdown.Content,
|
||||
"<font color=\"warning\">233</font>")
|
||||
}
|
||||
Reference in New Issue
Block a user