public void ComposeStringToSign() { Dictionary <string, string> tmp = new Dictionary <string, string> { { "foo", "bar" }, { "a", "A" }, { "b", "B" } }; MethodType method = MethodType.GET; Signer signer = new HmacSHA1Signer(); ISignatureComposer instance = RoaSignatureComposer.GetComposer(); string result = instance.ComposeStringToSign(method, "uriPattern", signer, tmp, tmp, tmp); Assert.Equal("GET\n\n\n\n\nuriPattern?a=A&b=B&foo=bar", result); }
public void ComposeStringToSign() { RoaSignatureComposer.ClearComposer(); Dictionary <string, string> tmp = new Dictionary <string, string> { { "foo", "bar" }, { "a", "A" }, { "nullValue", null } }; MethodType method = MethodType.GET; Signer signer = new HmacSHA1Signer(); ISignatureComposer instance = RoaSignatureComposer.GetComposer(); string result = instance.ComposeStringToSign(method, "www.alibabacloud.com?", signer, tmp, tmp, tmp); Assert.Equal("GET\n\n\n\n\nwww.alibabacloud.com?&a=A&foo=bar&nullValue", result); }