[#11] Tests: Add MemberServiceTest
This commit is contained in:
25
Tests/ServiceTests/Setup.cs
Normal file
25
Tests/ServiceTests/Setup.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using Elwig.Helpers;
|
||||
using System.Reflection;
|
||||
using Microsoft.Data.Sqlite;
|
||||
|
||||
namespace Tests.ServiceTests {
|
||||
[SetUpFixture]
|
||||
public class Setup {
|
||||
|
||||
private SqliteConnection? Connection;
|
||||
|
||||
[OneTimeSetUp]
|
||||
public async Task SetupDatabase() {
|
||||
Connection = await AppDbContext.ConnectAsync();
|
||||
await AppDbContext.ExecuteEmbeddedScript(Connection, Assembly.GetExecutingAssembly(), "Tests.Resources.Sql.ServiceInsert.sql");
|
||||
}
|
||||
|
||||
[OneTimeTearDown]
|
||||
public async Task TeardownDatabase() {
|
||||
if (Connection == null) return;
|
||||
await AppDbContext.ExecuteEmbeddedScript(Connection, Assembly.GetExecutingAssembly(), "Tests.Resources.Sql.ServiceDelete.sql");
|
||||
await Connection.DisposeAsync();
|
||||
Connection = null;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user