Braintree.Tests.TransparentRedirectRequestTest.Constructor_RaisesAuthorizationExceptionWithMessageIfStatusIs403AndBtMessageIsInQueryString C# (CSharp) Method

Constructor_RaisesAuthorizationExceptionWithMessageIfStatusIs403AndBtMessageIsInQueryString() private method

        public void Constructor_RaisesAuthorizationExceptionWithMessageIfStatusIs403AndBtMessageIsInQueryString()
        {
            string message = "Invalid params: transaction[bad]";
            Exception exception = null;

            try {
                new TransparentRedirectRequest(string.Format("http_status=403&bt_message={0}&id=6kdj469tw7yck32j&hash=a839a44ca69d59a3d6f639c294794989676632dc", WebUtility.UrlEncode(message)), service);
            } catch (Exception localException) {
               exception = localException;
            }

            Assert.IsNotNull(exception);
            Assert.IsInstanceOf(typeof(AuthorizationException),exception);
            Assert.AreEqual(message, exception.Message);
        }
    }