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); }
private DefaultProfile(String regionId) { this.locationConfig = new LocationConfig(); this.iendpoints = new InternalEndpointsParser(); this.remoteProvider = RemoteEndpointsParser.InitRemoteEndpointsParser(); this.regionId = regionId; }
private DefaultProfile(ICredentialProvider icredential) { this.icredential = icredential; this.iendpoints = new InternalEndpointsParser(); this.remoteProvider = RemoteEndpointsParser.InitRemoteEndpointsParser(); this.locationConfig = new LocationConfig(); }
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); }
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); }
private DefaultProfile(String region, ICredentialProvider icredential) { this.regionId = region; this.icredential = icredential; this.iendpoints = new InternalEndpointsParser(); this.remoteProvider = RemoteEndpointsParser.InitRemoteEndpointsParser(); }
private DefaultProfile(String region, Credential creden) { iendpoints = new InternalEndpointsParser(); credential = creden; this.regionId = region; this.remoteProvider = RemoteEndpointsParser.InitRemoteEndpointsParser(); }
private DefaultProfile(string region, ICredentialProvider icredential) { iendpoints = new InternalEndpointsParser(); this.icredential = icredential; regionId = region; locationConfig = new LocationConfig(); remoteProvider = RemoteEndpointsParser.InitRemoteEndpointsParser(); }
private DefaultProfile(string region, Credential creden) { iendpoints = new InternalEndpointsParser(); remoteProvider = RemoteEndpointsParser.InitRemoteEndpointsParser(); credential = creden; regionId = region; locationConfig = new LocationConfig(); }
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(); }
public void GetEndpoint() { var instance = new RemoteEndpointsParser(); Assert.Throws <NotSupportedException>( () => { instance.GetEndpoint("", ""); } ); }
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(); }
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); }
private DefaultProfile() { locationConfig = new LocationConfig(); iendpoints = new InternalEndpointsParser(); remoteProvider = RemoteEndpointsParser.InitRemoteEndpointsParser(); }
public DefaultProfile(bool mock) { locationConfig = new LocationConfig(); iendpoints = new InternalEndpointsParser(); remoteProvider = RemoteEndpointsParser.InitRemoteEndpointsParser(); }
private DefaultProfile() { this.iendpoints = new InternalEndpointsParser(); this.remoteProvider = RemoteEndpointsParser.InitRemoteEndpointsParser(); }
public DefaultProfile(bool mock = true) { this.locationConfig = new LocationConfig(); this.iendpoints = new InternalEndpointsParser(); this.remoteProvider = RemoteEndpointsParser.InitRemoteEndpointsParser(); }