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 | 2c6b812382e04956793d90ba4148dd4aa7da3b70 (patch) | |
tree | 80dd68888d34e2ae132753c3977e84b179333187 /BackEnd/Timeline.Tests/Services/DatabaseBasedTest.cs | |
parent | 1dfafd9400c158576f9ede8f3012356746cb5ae0 (diff) | |
download | timeline-2c6b812382e04956793d90ba4148dd4aa7da3b70.tar.gz timeline-2c6b812382e04956793d90ba4148dd4aa7da3b70.tar.bz2 timeline-2c6b812382e04956793d90ba4148dd4aa7da3b70.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();
|