diff options
author | crupest <crupest@outlook.com> | 2020-12-17 23:49:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-17 23:49:16 +0800 |
commit | 3b3c7c170f0070b0db85834b6c913b9060996d1d (patch) | |
tree | f5ce5a6ffebab52a4a990faa0d12937244cc3185 /BackEnd/Timeline.Tests/Services/DatabaseBasedTest.cs | |
parent | 828da7516df1a7612c3b24b4a27ba680eaf821f8 (diff) | |
parent | 5cbc306fc82bf14157ced4ff8b935191d20dae5d (diff) | |
download | timeline-3b3c7c170f0070b0db85834b6c913b9060996d1d.tar.gz timeline-3b3c7c170f0070b0db85834b6c913b9060996d1d.tar.bz2 timeline-3b3c7c170f0070b0db85834b6c913b9060996d1d.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.cs | 10 |
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();
}
|