Esempio n. 1
0
        public void CheckToMakeSureProtocolNotSetForTempCreds()
        {
            var client = new AmazonCognitoIdentityProviderClient("accessKeyId", "secretKey", "sessionToken", Amazon.RegionEndpoint.USEast1);

            Exception caughtException = null;

            try
            {
                client.SignUp(new SignUpRequest
                {
                    ClientId = "clientId",
                    Username = "******",
                    Password = "******"
                });
            }
            catch (Exception e)
            {
                caughtException = e;
            }

            Assert.IsNotNull(caughtException);

            // The Signer pipeline handler will throw an InvalidDataException if it fails to determine
            // protocol.
            Assert.IsNotInstanceOfType(caughtException, typeof(InvalidDataException));

            // The actual exception thrown which is a Cognito Identity Provider exception.
            // Although the previous Assert catches the case for the bug fix. This check is here
            // in case the internal code changes in the future.
            Assert.IsInstanceOfType(caughtException, typeof(ResourceNotFoundException));
        }