初始化项目

This commit is contained in:
2022-07-21 23:10:41 +08:00
parent 858ee66482
commit 05b77d99c7
16 changed files with 636 additions and 7 deletions

23
markdown_test.go Normal file
View 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>")
}