コード例 #1
0
        public void GetEndpointWhenResponseIsNull()
        {
            DescribeEndpointResponse response = null;

            var mock = new Mock <DescribeEndpointService>();

            //String regionId, String serviceCode, String endpointType,Credential credential,LocationConfig locationConfig
            mock.Setup(foo => foo.DescribeEndpoint(
                           It.IsAny <string>(),
                           It.IsAny <string>(),
                           It.IsAny <string>(),
                           It.IsAny <Credential>(),
                           It.IsAny <LocationConfig>()
                           )).Returns(response);

            DescribeEndpointService describeEndpointService = mock.Object;
            RemoteEndpointsParser   instance = new RemoteEndpointsParser();

            instance.SetDescribeEndpointService(describeEndpointService);

            Credential     credential     = new Credential();
            LocationConfig locationConfig = new LocationConfig();
            var            result         = instance.GetEndpoint("regionId", "product", "serviceCode", "endpointType", credential, locationConfig);

            Assert.Null(result);
        }
コード例 #2
0
 private DefaultProfile(String regionId)
 {
     this.locationConfig = new LocationConfig();
     this.iendpoints     = new InternalEndpointsParser();
     this.remoteProvider = RemoteEndpointsParser.InitRemoteEndpointsParser();
     this.regionId       = regionId;
 }
コード例 #3
0
 private DefaultProfile(ICredentialProvider icredential)
 {
     this.icredential    = icredential;
     this.iendpoints     = new InternalEndpointsParser();
     this.remoteProvider = RemoteEndpointsParser.InitRemoteEndpointsParser();
     this.locationConfig = new LocationConfig();
 }
コード例 #4
0
        public void GetEndpointWhenResponseIsNotNull()
        {
            var response = new DescribeEndpointResponse();

            response.RegionId = "RegionId";
            response.Endpoint = "Endpoint";

            var mock = new Mock <DescribeEndpointService>();

            mock.Setup(foo => foo.DescribeEndpoint(
                           It.IsAny <string>(),
                           It.IsAny <string>(),
                           It.IsAny <string>(),
                           It.IsAny <Credential>(),
                           It.IsAny <LocationConfig>()
                           )).Returns(response);

            var instance = new RemoteEndpointsParser();

            var credential     = new Credential();
            var locationConfig = new LocationConfig();
            var result         = instance.GetEndpoint("regionId", "product", "serviceCode", "endpointType", credential,
                                                      locationConfig);

            Assert.Null(result);
        }
コード例 #5
0
        public void GetEndpointWhenResponseIsNotNull()
        {
            DescribeEndpointResponse response = new DescribeEndpointResponse();

            response.RegionId = "RegionId";
            response.Endpoint = "Endpoint";

            var mock = new Mock <DescribeEndpointService>();

            mock.Setup(foo => foo.DescribeEndpoint(
                           It.IsAny <string>(),
                           It.IsAny <string>(),
                           It.IsAny <string>(),
                           It.IsAny <Credential>(),
                           It.IsAny <LocationConfig>()
                           )).Returns(response);

            DescribeEndpointService describeEndpointService = mock.Object;
            RemoteEndpointsParser   instance = new RemoteEndpointsParser();

            instance.SetDescribeEndpointService(describeEndpointService);

            Credential     credential     = new Credential();
            LocationConfig locationConfig = new LocationConfig();
            var            result         = instance.GetEndpoint("regionId", "product", "serviceCode", "endpointType", credential, locationConfig);

            Assert.IsType <Endpoint>(result);
            Assert.NotNull(result);
            Assert.Equal("RegionId", result.Name);
            Assert.NotEmpty(result.ProductDomains);
            Assert.NotEmpty(result.RegionIds);
        }
コード例 #6
0
 private DefaultProfile(String region, ICredentialProvider icredential)
 {
     this.regionId       = region;
     this.icredential    = icredential;
     this.iendpoints     = new InternalEndpointsParser();
     this.remoteProvider = RemoteEndpointsParser.InitRemoteEndpointsParser();
 }
コード例 #7
0
 private DefaultProfile(String region, Credential creden)
 {
     iendpoints          = new InternalEndpointsParser();
     credential          = creden;
     this.regionId       = region;
     this.remoteProvider = RemoteEndpointsParser.InitRemoteEndpointsParser();
 }
コード例 #8
0
 private DefaultProfile(string region, ICredentialProvider icredential)
 {
     iendpoints       = new InternalEndpointsParser();
     this.icredential = icredential;
     regionId         = region;
     locationConfig   = new LocationConfig();
     remoteProvider   = RemoteEndpointsParser.InitRemoteEndpointsParser();
 }
コード例 #9
0
 private DefaultProfile(string region, Credential creden)
 {
     iendpoints     = new InternalEndpointsParser();
     remoteProvider = RemoteEndpointsParser.InitRemoteEndpointsParser();
     credential     = creden;
     regionId       = region;
     locationConfig = new LocationConfig();
 }
コード例 #10
0
 private DefaultProfile(String region, Credential creden, IEndpointsProvider provider)
 {
     this.iendpoints     = provider;
     this.credential     = creden;
     this.regionId       = region;
     this.locationConfig = new LocationConfig();
     this.remoteProvider = RemoteEndpointsParser.InitRemoteEndpointsParser();
 }
コード例 #11
0
        public void GetEndpoint()
        {
            var instance = new RemoteEndpointsParser();

            Assert.Throws <NotSupportedException>(
                () => { instance.GetEndpoint("", ""); }
                );
        }
コード例 #12
0
 private DefaultProfile(ICredentialProvider icredential, String region, FormatType format)
 {
     this.regionId       = region;
     this.AcceptFormat   = format;
     this.icredential    = icredential;
     this.iendpoints     = new InternalEndpointsParser();
     this.remoteProvider = RemoteEndpointsParser.InitRemoteEndpointsParser();
 }
コード例 #13
0
        public void GetEndpointWhenServiceCodeIsNull()
        {
            RemoteEndpointsParser instance       = new RemoteEndpointsParser();
            Credential            credential     = new Credential();
            LocationConfig        locationConfig = new LocationConfig();
            var result = instance.GetEndpoint("regionId", "product", null, "endpointType", credential, locationConfig);

            Assert.Null(result);
        }
コード例 #14
0
 private DefaultProfile()
 {
     locationConfig = new LocationConfig();
     iendpoints     = new InternalEndpointsParser();
     remoteProvider = RemoteEndpointsParser.InitRemoteEndpointsParser();
 }
コード例 #15
0
 public DefaultProfile(bool mock)
 {
     locationConfig = new LocationConfig();
     iendpoints     = new InternalEndpointsParser();
     remoteProvider = RemoteEndpointsParser.InitRemoteEndpointsParser();
 }
コード例 #16
0
 private DefaultProfile()
 {
     this.iendpoints     = new InternalEndpointsParser();
     this.remoteProvider = RemoteEndpointsParser.InitRemoteEndpointsParser();
 }
コード例 #17
0
 public DefaultProfile(bool mock = true)
 {
     this.locationConfig = new LocationConfig();
     this.iendpoints     = new InternalEndpointsParser();
     this.remoteProvider = RemoteEndpointsParser.InitRemoteEndpointsParser();
 }