mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-07 11:12:27 +00:00
The Great Formatting of 2022
This commit is contained in:
parent
59cc7f02fb
commit
35f50f5f8c
162 changed files with 6609 additions and 6809 deletions
|
@ -2,28 +2,22 @@ using LBPUnion.ProjectLighthouse.Types.Settings;
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Xunit;
|
||||
|
||||
namespace LBPUnion.ProjectLighthouse.Tests
|
||||
{
|
||||
public sealed class DatabaseFactAttribute : FactAttribute
|
||||
{
|
||||
private static readonly object migrateLock = new();
|
||||
namespace LBPUnion.ProjectLighthouse.Tests;
|
||||
|
||||
public DatabaseFactAttribute()
|
||||
{
|
||||
ServerSettings.Instance = new ServerSettings();
|
||||
ServerSettings.Instance.DbConnectionString = "server=127.0.0.1;uid=root;pwd=lighthouse;database=lighthouse";
|
||||
if (!ServerStatics.DbConnected)
|
||||
public sealed class DatabaseFactAttribute : FactAttribute
|
||||
{
|
||||
private static readonly object migrateLock = new();
|
||||
|
||||
public DatabaseFactAttribute()
|
||||
{
|
||||
ServerSettings.Instance = new ServerSettings();
|
||||
ServerSettings.Instance.DbConnectionString = "server=127.0.0.1;uid=root;pwd=lighthouse;database=lighthouse";
|
||||
if (!ServerStatics.DbConnected) this.Skip = "Database not available";
|
||||
else
|
||||
lock(migrateLock)
|
||||
{
|
||||
this.Skip = "Database not available";
|
||||
using Database database = new();
|
||||
database.Database.Migrate();
|
||||
}
|
||||
else
|
||||
{
|
||||
lock(migrateLock)
|
||||
{
|
||||
using Database database = new();
|
||||
database.Database.Migrate();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue