aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline.Tests/Helpers
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-05-15 22:31:59 +0800
committercrupest <crupest@outlook.com>2021-05-15 22:31:59 +0800
commitb10261186393aacf6cf07491d322f0224c94158f (patch)
tree87ba89ba67f4d938b06e3b0cb08b3960a90c3675 /BackEnd/Timeline.Tests/Helpers
parent2a3c2d60cadbae348632ad9f2023367c5ea1e905 (diff)
downloadtimeline-b10261186393aacf6cf07491d322f0224c94158f.tar.gz
timeline-b10261186393aacf6cf07491d322f0224c94158f.tar.bz2
timeline-b10261186393aacf6cf07491d322f0224c94158f.zip
test: Use xunit logging output.
Diffstat (limited to 'BackEnd/Timeline.Tests/Helpers')
-rw-r--r--BackEnd/Timeline.Tests/Helpers/TestApplication.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/BackEnd/Timeline.Tests/Helpers/TestApplication.cs b/BackEnd/Timeline.Tests/Helpers/TestApplication.cs
index 723ef500..2c2856c1 100644
--- a/BackEnd/Timeline.Tests/Helpers/TestApplication.cs
+++ b/BackEnd/Timeline.Tests/Helpers/TestApplication.cs
@@ -4,16 +4,25 @@ using Microsoft.AspNetCore.TestHost;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
+using Microsoft.Extensions.Logging;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using Timeline.Configs;
using Xunit;
+using Xunit.Abstractions;
namespace Timeline.Tests.Helpers
{
public class TestApplication : IAsyncLifetime
{
+ private readonly ITestOutputHelper _testOutputHelper;
+
+ public TestApplication(ITestOutputHelper testOutputHelper)
+ {
+ _testOutputHelper = testOutputHelper;
+ }
+
public IHost Host { get; private set; } = default!;
public string WorkDirectory { get; private set; } = default!;
@@ -24,6 +33,11 @@ namespace Timeline.Tests.Helpers
Directory.CreateDirectory(WorkDirectory);
Host = await Microsoft.Extensions.Hosting.Host.CreateDefaultBuilder()
+ .ConfigureLogging(logging =>
+ {
+ logging.ClearProviders();
+ logging.AddXUnit(_testOutputHelper);
+ })
.ConfigureAppConfiguration((context, config) =>
{
config.AddInMemoryCollection(new Dictionary<string, string>