Esempio n. 1
0
        public void BearerTokenAccessTest()
        {
            var provider = new BearerTokenCredentialProvider(FeatureCommon.GetBearerToken());

            DefaultProfile.ClearProfile();
            var profile = DefaultProfile.GetProfile("cn-hangzhou");
            var client  = new DefaultAcsClient(profile, provider);

            var request = new ListPhoneNumbersRequest();

            var exception = Assert.Throws <ClientException>(() =>
            {
                var response = client.GetAcsResponse(request);
            });

            Assert.Equal("InvalidBearerToken.Inactive", exception.ErrorCode);
        }