E2ETests: Use ElwigTestDB.sqlite3 instead of default
All checks were successful
Test / Run tests (push) Successful in 2m38s
All checks were successful
Test / Run tests (push) Successful in 2m38s
This commit is contained in:
@ -1,4 +1,7 @@
|
||||
namespace Tests.E2ETests {
|
||||
using Elwig.Helpers;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Tests.E2ETests {
|
||||
[SetUpFixture]
|
||||
public static class Setup {
|
||||
|
||||
@ -9,9 +12,25 @@
|
||||
Driver = new();
|
||||
}
|
||||
|
||||
[OneTimeSetUp]
|
||||
public static async Task SetupDatabase() {
|
||||
if (File.Exists(Utils.TestDatabasePath)) File.Delete(Utils.TestDatabasePath);
|
||||
using var cnx = await AppDbContext.ConnectAsync($"Data Source=\"{Utils.TestDatabasePath}\"; Mode=ReadWriteCreate; Foreign Keys=True; Cache=Default");
|
||||
await AppDbContext.ExecuteEmbeddedScript(cnx, Assembly.GetExecutingAssembly(), "Tests.Resources.Sql.Create.sql");
|
||||
await AppDbContext.ExecuteEmbeddedScript(cnx, Assembly.GetExecutingAssembly(), "Tests.Resources.Sql.Insert.sql");
|
||||
}
|
||||
|
||||
[OneTimeTearDown]
|
||||
public static void TeardownWinAppDriver() {
|
||||
Driver?.Dispose();
|
||||
}
|
||||
|
||||
[OneTimeTearDown]
|
||||
public static void TeardownDatabase() {
|
||||
try {
|
||||
// FIXME not working - other process using file
|
||||
File.Delete(Utils.TestDatabasePath);
|
||||
} catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user