| import "testing" | import "testing" | ||||
| func TestBuildTxtMsg(t *testing.T) { | func TestBuildTxtMsg(t *testing.T) { | ||||
| BuildTextMsg("你好", "oUN420bxqFqlx0ZQHciUOesZO3PE") | |||||
| SetupConfig() | |||||
| s, _ := BuildTextMsg("你好", "oUN420bxqFqlx0ZQHciUOesZO3PE") | |||||
| e := ReadEncryptedMsg(s) | |||||
| sd := Decode(e.Encrypt) | |||||
| h := ReadCommonHeader(sd) | |||||
| m := ReadTextMsg(sd) | |||||
| AssertEqual(t, m.Content, "你好", "Message content => wrong") | |||||
| AssertEqual(t, h.ToUserName, "oUN420bxqFqlx0ZQHciUOesZO3PE", "ToUserName => wrong") | |||||
| } | } | ||||
| func TextCalculateSignature (t *testing.T ){ | |||||
| } | |||||
| func TestCalculateSignature(t *testing.T) { | |||||
| } |