Skip to content

Commit

Permalink
Merge pull request #23 from Ali-YousefiTelori/develop
Browse files Browse the repository at this point in the history
update test settings
  • Loading branch information
Ali-YousefiTelori authored Feb 1, 2024
2 parents a56c9c8 + 3a75276 commit 88eff3a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Identity.GeneratedServices;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace EasyMicroservices.IdentityMicroservice.Tests.Fixtures;
Expand All @@ -20,8 +21,11 @@ public Task DisposeAsync()

public async Task InitializeAsync()
{
IConfiguration config = new ConfigurationBuilder()
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.Build();
var app = Program.CreateBuilder(null);
string baseUrl = $"http://localhost:{2007}";
string baseUrl = config.GetSection("Urls").Get<string>().Replace("*","localhost");
app.Services.AddSingleton(s => new HttpClient());
app.Services.AddTransient(s => new AuthenticationClient(baseUrl, s.GetService<HttpClient>()));
app.Services.AddMvc().AddApplicationPart(typeof(AuthenticationController).Assembly);
Expand Down

0 comments on commit 88eff3a

Please sign in to comment.