diff options
author | crupest <crupest@outlook.com> | 2020-11-12 20:03:31 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-11-12 20:03:31 +0800 |
commit | b81a66ff49f5d9305108e92a009449ee5994862e (patch) | |
tree | e6e42fbeb66b97d104d6624bfbcd2e5a5ebbe3c5 /BackEnd/Timeline.Tests/Services/DatabaseBasedTest.cs | |
parent | 0af4e8c9e788a3bbf4d6879a7f42660cb47ddedb (diff) | |
download | timeline-b81a66ff49f5d9305108e92a009449ee5994862e.tar.gz timeline-b81a66ff49f5d9305108e92a009449ee5994862e.tar.bz2 timeline-b81a66ff49f5d9305108e92a009449ee5994862e.zip |
test: Write tests for user permission service.
Diffstat (limited to 'BackEnd/Timeline.Tests/Services/DatabaseBasedTest.cs')
-rw-r--r-- | BackEnd/Timeline.Tests/Services/DatabaseBasedTest.cs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/BackEnd/Timeline.Tests/Services/DatabaseBasedTest.cs b/BackEnd/Timeline.Tests/Services/DatabaseBasedTest.cs index 838787e9..7c97158c 100644 --- a/BackEnd/Timeline.Tests/Services/DatabaseBasedTest.cs +++ b/BackEnd/Timeline.Tests/Services/DatabaseBasedTest.cs @@ -1,7 +1,4 @@ -using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
+using System.Threading.Tasks;
using Timeline.Entities;
using Timeline.Tests.Helpers;
using Xunit;
@@ -10,9 +7,14 @@ namespace Timeline.Tests.Services {
public abstract class DatabaseBasedTest : IAsyncLifetime
{
- protected TestDatabase TestDatabase { get; } = new TestDatabase();
+ protected TestDatabase TestDatabase { get; }
protected DatabaseContext Database { get; private set; }
+ protected DatabaseBasedTest(bool databaseCreateUsers = true)
+ {
+ TestDatabase = new TestDatabase(databaseCreateUsers);
+ }
+
public async Task InitializeAsync()
{
await TestDatabase.InitializeAsync();
|