-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathSenderAppFactory.cs
More file actions
36 lines (32 loc) · 986 Bytes
/
SenderAppFactory.cs
File metadata and controls
36 lines (32 loc) · 986 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using Ev.ServiceBus.Samples.Sender;
using Ev.ServiceBus.UnitTests.Helpers;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.AspNetCore.TestHost;
using Microsoft.Extensions.Logging;
namespace Ev.ServiceBus.AsyncApi.UnitTests;
public class SenderAppFactory : WebApplicationFactory<Program>
{
protected override void ConfigureWebHost(IWebHostBuilder builder)
{
SetupConsoleLogging(builder);
builder.ConfigureTestServices(
services =>
{
services.OverrideClientFactory();
});
}
private static void SetupConsoleLogging(IWebHostBuilder builder)
{
builder.ConfigureLogging(loggingBuilder =>
{
loggingBuilder.AddConsole(options =>
{
#pragma warning disable 618
options.DisableColors = false;
options.IncludeScopes = true;
#pragma warning restore 618
});
});
}
}