aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline.Tests/Services/DatabaseBasedTest.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-12-17 23:49:16 +0800
committerGitHub <noreply@github.com>2020-12-17 23:49:16 +0800
commitebc2892d1546b8b59bd1c9adabe8a96a2e2a0754 (patch)
treef27b279237a6a7ab3b6a09206f3fec6a5524674b /BackEnd/Timeline.Tests/Services/DatabaseBasedTest.cs
parentb0ee9afddd4f7ecf8a183ab8d8e9e575324a2b68 (diff)
parentd452781c81e6d19076cf9d356877e154b2e34e91 (diff)
downloadtimeline-ebc2892d1546b8b59bd1c9adabe8a96a2e2a0754.tar.gz
timeline-ebc2892d1546b8b59bd1c9adabe8a96a2e2a0754.tar.bz2
timeline-ebc2892d1546b8b59bd1c9adabe8a96a2e2a0754.zip
Merge pull request #192 from crupest/highlight-timeline
Highlight timeline.
Diffstat (limited to 'BackEnd/Timeline.Tests/Services/DatabaseBasedTest.cs')
-rw-r--r--BackEnd/Timeline.Tests/Services/DatabaseBasedTest.cs10
1 files changed, 8 insertions, 2 deletions
diff --git a/BackEnd/Timeline.Tests/Services/DatabaseBasedTest.cs b/BackEnd/Timeline.Tests/Services/DatabaseBasedTest.cs
index 3bb6ebb5..90fb6463 100644
--- a/BackEnd/Timeline.Tests/Services/DatabaseBasedTest.cs
+++ b/BackEnd/Timeline.Tests/Services/DatabaseBasedTest.cs
@@ -2,6 +2,7 @@
using Timeline.Entities;
using Timeline.Tests.Helpers;
using Xunit;
+using Xunit.Abstractions;
namespace Timeline.Tests.Services
{
@@ -10,15 +11,20 @@ namespace Timeline.Tests.Services
protected TestDatabase TestDatabase { get; }
protected DatabaseContext Database { get; private set; } = default!;
- protected DatabaseBasedTest(bool databaseCreateUsers = true)
+ private readonly ITestOutputHelper? _testOutputHelper;
+
+ protected DatabaseBasedTest(bool databaseCreateUsers = true, ITestOutputHelper? testOutputHelper = null)
{
+ _testOutputHelper = testOutputHelper;
TestDatabase = new TestDatabase(databaseCreateUsers);
}
+ protected DatabaseBasedTest(ITestOutputHelper? testOutputHelper) : this(true, testOutputHelper) { }
+
public async Task InitializeAsync()
{
await TestDatabase.InitializeAsync();
- Database = TestDatabase.CreateContext();
+ Database = TestDatabase.CreateContext(_testOutputHelper);
await OnDatabaseCreatedAsync();
OnDatabaseCreated();
}