コード例 #1
0
        public void RequestTokenShouldHandleInvalidArgumentException()
        {
            var uri      = new Uri("http://localhost?state=state&nonce=nonce");
            var response = _mobileConnect.RequestToken(null, uri, "state", "nonce");

            Assert.IsNotNull(response);
            Assert.AreEqual(MobileConnectResponseType.Error, response.ResponseType);
            Assert.IsInstanceOf <MobileConnectInvalidArgumentException>(response.Exception);
        }
コード例 #2
0
        public void RequestTokenShouldHandleInvalidArgumentException()
        {
            var discoveryResponse = new DiscoveryResponse(new RestResponse(System.Net.HttpStatusCode.OK, responseJson));

            discoveryResponse.ProviderMetadata             = ProviderMetadata.Default;
            discoveryResponse.OperatorUrls.RequestTokenUrl = null;
            var uri      = new Uri("http://localhost?state=state&nonce=nonce");
            var response = _mobileConnect.RequestToken(discoveryResponse, uri, "state", "nonce", new MobileConnectRequestOptions());

            Assert.IsNotNull(response);
            Assert.AreEqual(MobileConnectResponseType.Error, response.ResponseType);
            Assert.IsInstanceOf <MobileConnectInvalidArgumentException>(response.Exception);
        }