Exemplo n.º 1
0
 public ServiceUrlBuilder(ServiceType serviceType, IAuthenticationProvider authenticationProvider, string region, bool useInternalUrl)
 {
     _serviceType = serviceType;
     _authenticationProvider = authenticationProvider;
     _region = region;
     _useInternalUrl = useInternalUrl;
 }
        public async void WhenUsingHPIdentityProvider_EveryServiceTypeCanResolveAnEndpoint(ServiceType serviceType)
        {
            UserAccess userAccess = JsonConvert.DeserializeObject<UserAccess>(UserAccessJson);
            var hpIdentityProvider = new Mock<HpIdentityProvider>(new CloudIdentity()){CallBase = true};
            hpIdentityProvider.Setup(x => x.GetUserAccess(It.IsAny<CloudIdentity>(), It.IsAny<bool>())).Returns(userAccess);
            IAuthenticationProvider authenticationProvider = hpIdentityProvider.Object;

            string result = await authenticationProvider.GetEndpoint(serviceType, "region-a.geo-1", false, CancellationToken.None);
            Assert.NotNull(result);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Determines if this instance is equal to the specified instance.
 /// </summary>
 /// <param name="other">The other instance to which this instance should be compared.</param>
 /// <returns>If the two instances are equal.</returns>
 protected bool Equals(ServiceType other)
 {
     return string.Equals(Type, other.Type, StringComparison.OrdinalIgnoreCase);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Determines if this instance is equal to the specified instance.
 /// </summary>
 /// <param name="other">The other instance to which this instance should be compared.</param>
 /// <returns>If the two instances are equal.</returns>
 protected bool Equals(ServiceType other)
 {
     return(string.Equals(Type, other.Type, StringComparison.OrdinalIgnoreCase));
 }