Ejemplo n.º 1
0
        public void BasicRoaTokenConnection()
        {
            if (FeatureTest.RoleArn.Equals("FakeRoleArn"))
            {
                return;
            }

            var basciCredential =
                new BasicSessionCredentials(FeatureTest.BasicAccessKeyId, FeatureTest.BasicAccessKeySecret, FeatureTest.GetToken());
            var profile = DefaultProfile.GetProfile(FeatureTest.RegionId, FeatureTest.BasicAccessKeyId, FeatureTest.BasicAccessKeySecret);
            var client  = new DefaultAcsClient(profile, basciCredential);

            var request = new CommonRequest();

            request.Domain     = "ros.aliyuncs.com";
            request.Version    = "2015-09-01";
            request.Action     = "DescribeResourceTypes";
            request.UriPattern = "/resource_types";
            request.Method     = MethodType.GET;

            var response = client.GetCommonResponse(request);

            Assert.Equal(200, response.HttpStatus);
            Assert.NotNull(response.Data);
        }
Ejemplo n.º 2
0
        public void BasicRpcStsTokenConnectionsTest()
        {
            if (FeatureTest.RoleArn.Equals("FakeRoleArn"))
            {
                return;
            }

            var basciCredential =
                new BasicSessionCredentials(FeatureTest.BasicAccessKeyId, FeatureTest.BasicAccessKeySecret, FeatureTest.GetToken());
            var profile = DefaultProfile.GetProfile(FeatureTest.RegionId, FeatureTest.BasicAccessKeyId, FeatureTest.BasicAccessKeySecret);
            var client  = new DefaultAcsClient(profile, basciCredential);

            var request  = new DescribeAccessControlListsRequest();
            var response = client.GetAcsResponse(request);

            Assert.NotNull(response);
        }
Ejemplo n.º 3
0
        public void UnicodeAndQueryTest()
        {
            if (FeatureTest.RoleArn.Equals("FakeRoleArn"))
            {
                return;
            }

            var basciCredential =
                new BasicSessionCredentials(FeatureTest.BasicAccessKeyId, FeatureTest.BasicAccessKeySecret, FeatureTest.GetToken());
            var profile = DefaultProfile.GetProfile(FeatureTest.RegionId, FeatureTest.BasicAccessKeyId, FeatureTest.BasicAccessKeySecret);
            var client  = new DefaultAcsClient(profile, basciCredential);

            var request = new CommonRequest();

            request.TimeoutInMilliSeconds = 30000;
            request.Domain     = "ros.aliyuncs.com";
            request.Version    = "2015-09-01";
            request.Action     = "DescribeResourceTypes";
            request.UriPattern = "/resource_types";
            request.Method     = MethodType.GET;
            request.QueryParameters.Add("testParams", "SDFSDFSAetTEWTEWQO(∩_∩)O哈哈~");

            var response = client.GetCommonResponse(request);

            Assert.Equal(200, response.HttpStatus);
            Assert.NotNull(response.Data);
        }