Parcourir la source

verify building message

master
Patrick Peng Sun il y a 8 ans
Parent
révision
12282ea8e9
1 fichiers modifiés avec 11 ajouts et 4 suppressions
  1. +11
    -4
      outMsg_test.go

+ 11
- 4
outMsg_test.go Voir le fichier

@@ -3,9 +3,16 @@ package main
import "testing"

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) {
}

Chargement…
Annuler
Enregistrer