GetSignedUri() public method

public GetSignedUri ( Uri uri ) : string
uri System.Uri
return string
コード例 #1
0
        public void Api_Key_Signing()
        {
            var sign = new GoogleSigned("mykey");

            string signed = sign.GetSignedUri("http://a/dummy/server?a=b");

            Assert.AreEqual("http://a/dummy/server?a=b&key=mykey", signed);
        }
コード例 #2
0
        public void ctor_ApiKey_And_Signature()
        {
            //arrange
            string expected = BASE_URI + "&key=" + APIKEY + "&signature=ZSPqURu7BsGJ_XybwhRY4kk3Zhg=";

            //act
            GoogleSigned sign   = new GoogleSigned(APIKEY, SHARED_SECRET);
            string       actual = sign.GetSignedUri(BASE_URI);

            //assert
            Assert.AreEqual(expected, actual);
        }
コード例 #3
0
        public void ctor_ApiKey()
        {
            //arrange
            string expected = BASE_URI + "&key=" + APIKEY;

            //act
            GoogleSigned sign   = new GoogleSigned(APIKEY);
            string       actual = sign.GetSignedUri(BASE_URI);

            //assert
            Assert.AreEqual(expected, actual);
        }
コード例 #4
0
        public void ctor_ClientId_ForBusiness_Signed()
        {
            //arrange
            var expected = BASE_URI + "&client=" + CLIENT_ID + "&signature=uq9UYD8EJ2JIXvdNGkiMr5FsVdI=";

            //act
            var GoogleSigned = new GoogleSigned(CLIENT_ID, SHARED_SECRET, GoogleSignedType.Business);
            var actual       = GoogleSigned.GetSignedUri(BASE_URI);

            //assert
            Assert.AreEqual(expected, actual);
        }