Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update test settings #23

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading