public void Should_NotHaveAnAuthType() { var configuration = new AzureMapsConfiguration(); Assert.Null(configuration.AuthType); Assert.False(configuration.Validate()); }
public AzureMapsService(ILogger <AzureMapsService> logger, AzureMapsConfiguration azureMapsConfiguration, HttpClient httpClient) { this.Logger = logger; this.AzureMapsConfiguration = azureMapsConfiguration; this.HttpClient = httpClient; }
public AzureMapsController(AzureMapsConfiguration azureMapsConfiguration, PTI.Microservices.Library.Services.AzureMapsService azureMapsService ) { this.azureMapsConfiguration = azureMapsConfiguration; this.azureMapsService = azureMapsService; }
public AzureMapFixture() { MapService = new Mock <IMapAdderService>(); JsRuntime = new Mock <IMapJsRuntime>(); Logger = new Mock <ILogger <AzureMap> >(); Configuration = new AzureMapsConfiguration(); TestContext = new TestContext(); }
public void Should_HaveAnonymousAuthType() { var configuration = new AzureMapsConfiguration { ClientId = "clientId" }; Assert.Equal("anonymous", configuration.AuthType); Assert.True(configuration.Validate()); }
public AzMapsGeocoder(IConfiguration configuration, IHttpClientFactory clientFactory, CosmosClient CosmosClient) { config = configuration; _settings = new AzureMapsConfiguration(); config.GetSection("AzureMaps").Bind(_settings); _clientFactory = clientFactory; cosmosClient = CosmosClient; inContainer = cosmosClient.GetContainer("AzureMaps", "<SOURCE ADDRESS COSMOS DB COLLECTION NAME"); gcContainer = cosmosClient.GetContainer("AzureMaps", "<OUTPUT COLLECTION NAME>"); }
public void Should_HaveAddAuthType() { var configuration = new AzureMapsConfiguration { AadAppId = "aadAppId", AadTenant = "aadTenant", ClientId = "clientId", }; Assert.Equal("aad", configuration.AuthType); Assert.True(configuration.Validate()); }
public void Should_HaveSubscriptionKeyAuthType() { var configuration = new AzureMapsConfiguration { AadAppId = "aadAppId", AadTenant = "aadTenant", ClientId = "clientId", SubscriptionKey = "subscriptionKey" }; Assert.Equal("subscriptionKey", configuration.AuthType); Assert.True(configuration.Validate()); }
// This method gets called by the runtime. Use this method to add services to the container. // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { AzureMapsConfiguration azureMapsConfiguration = this.Configuration.GetSection("AzureMapsConfiguration") .Get <AzureMapsConfiguration>(); services.AddSingleton(azureMapsConfiguration); var azuremapsServiceConfig = new PTI.Microservices.Library.Configuration.AzureMapsConfiguration() { Key = azureMapsConfiguration.SubscriptionKey }; PTI.Microservices.Library.Configuration.GlobalPackageConfiguration.RapidApiKey = "a3893edcbfmsh2efa1861dcc7a10p159864jsnf17e667d1bf7"; services.AddSingleton(azuremapsServiceConfig); services.AddTransient <CustomHttpClientHandler>(); services.AddTransient <CustomHttpClient>(); services.AddTransient <AzureMapsService>(); services.AddControllersWithViews(); services.AddRazorPages(); }