package paymentutil

import "testing"

func TestWechatV2SignIsStableAndExcludesSign(t *testing.T) {
	values := map[string]string{"b": "2", "a": "1", "sign": "old"}
	first := WechatV2Sign(values, "secret", "MD5")
	values["sign"] = "different"
	if second := WechatV2Sign(values, "secret", "MD5"); first != second {
		t.Fatalf("signature changed when sign field changed: %q != %q", first, second)
	}
}
