public void TestBasicFormatOfAuthorizationString()
        {
            TeleSignCredential credential = this.GetCredential();
            TeleSignAuthentication auth = new TeleSignAuthentication(credential);
            string authString = auth.ConstructAuthorizationString("FakeStringToSign", AuthenticationMethod.HmacSha1);

            string expectedStart = string.Format("TSA {0}:", credential.CustomerId);
            Assert.True(authString.StartsWith(expectedStart));
        }
Esempio n. 2
0
        public void TestAuthStringConstructionThrowsOnEmptyStringToSign()
        {
            TeleSignAuthentication auth = new TeleSignAuthentication(this.GetCredential());

            Assert.Throws <ArgumentException>(delegate
            {
                auth.ConstructAuthorizationString(string.Empty, AuthenticationMethod.HmacSha1);
            });
        }
        public void TestAuthStringConstructionThrowsOnEmptyStringToSign()
        {
            TeleSignAuthentication auth = new TeleSignAuthentication(this.GetCredential());

            Assert.Throws<ArgumentException>(delegate
            {
                auth.ConstructAuthorizationString(string.Empty, AuthenticationMethod.HmacSha1);
            });
        }
Esempio n. 4
0
        public void TestBasicFormatOfAuthorizationString()
        {
            TeleSignCredential     credential = this.GetCredential();
            TeleSignAuthentication auth       = new TeleSignAuthentication(credential);
            string authString = auth.ConstructAuthorizationString("FakeStringToSign", AuthenticationMethod.HmacSha1);

            string expectedStart = string.Format("TSA {0}:", credential.CustomerId);

            Assert.True(authString.StartsWith(expectedStart));
        }