Skip to content

Commit

Permalink
Cleanup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
msmolka committed Jan 30, 2022
1 parent 3dec062 commit 23bf9b8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,28 @@ namespace ZNetCS.AspNetCore.Authentication.BasicTests;
internal class EmptyWebApplicationFactory : WebApplicationFactory<EmptyStartup>
{
/// <inheritdoc/>
protected override IHostBuilder CreateHostBuilder()
{
return Host.CreateDefaultBuilder()
.ConfigureWebHostDefaults(
builder =>
{
builder.ConfigureServices(s => { s.AddMvc(); })
.Configure(
app =>
{
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseEndpoints(o => o.MapControllers());
})
.ConfigureLogging(
(_, logging) =>
{
logging
.AddFilter("Default", LogLevel.Debug)
.AddDebug();
});
});
}
protected override IHostBuilder CreateHostBuilder() => Host.CreateDefaultBuilder().ConfigureWebHostDefaults(_ => { });

/// <inheritdoc />
protected override void ConfigureWebHost(IWebHostBuilder builder)
{
builder.UseContentRoot(GetPath() ?? string.Empty);
builder.ConfigureServices(s => { s.AddMvc(); });
builder.Configure(
app =>
{
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseEndpoints(o => o.MapControllers());
});
builder.ConfigureLogging(
(_, logging) =>
{
logging
.AddFilter("Default", LogLevel.Debug)
.AddDebug();
});
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace ZNetCS.AspNetCore.Authentication.BasicTests;

#region Usings
#region Usings

using System.IO;
using System.Reflection;
Expand All @@ -24,28 +24,20 @@ namespace ZNetCS.AspNetCore.Authentication.BasicTests;
internal class StartupWebApplicationFactory : WebApplicationFactory<Startup>
{
/// <inheritdoc/>
protected override IHostBuilder CreateHostBuilder()
{
return Host.CreateDefaultBuilder()
.ConfigureWebHostDefaults(
builder =>
{
builder
.UseStartup<Startup>()
.ConfigureLogging(
(_, logging) =>
{
logging
.AddFilter("Default", LogLevel.Debug)
.AddDebug();
});
});
}
protected override IHostBuilder CreateHostBuilder() => Host.CreateDefaultBuilder().ConfigureWebHostDefaults(_ => { });

/// <inheritdoc />
protected override void ConfigureWebHost(IWebHostBuilder builder)
{
builder.UseContentRoot(GetPath() ?? string.Empty);
builder.UseStartup<Startup>();
builder.ConfigureLogging(
(_, logging) =>
{
logging
.AddFilter("Default", LogLevel.Debug)
.AddDebug();
});
}

/// <summary>
Expand Down

0 comments on commit 23bf9b8

Please sign in to comment.