mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-14 22:02:26 +00:00
* Make tests run in release mode * Fix multiple command in ci * I forgot how yaml works * Shitty workaround * grr mondays * Add an NP ticket builder for unit tests * Add NP ticket unit testing * Fix range indexers for finding uid * Fix LoginTests * Validate unit test signatures * Make builder code follow same style conventions * Remove remnant of hardcoded issuer id
25 lines
No EOL
733 B
C#
25 lines
No EOL
733 B
C#
using LBPUnion.ProjectLighthouse.Configuration;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Xunit;
|
|
|
|
namespace LBPUnion.ProjectLighthouse.Tests;
|
|
|
|
public sealed class DatabaseFactAttribute : FactAttribute
|
|
{
|
|
private static readonly object migrateLock = new();
|
|
|
|
public DatabaseFactAttribute()
|
|
{
|
|
ServerConfiguration.Instance = new ServerConfiguration
|
|
{
|
|
DbConnectionString = "server=127.0.0.1;uid=root;pwd=lighthouse;database=lighthouse",
|
|
};
|
|
if (!ServerStatics.DbConnected) this.Skip = "Database not available";
|
|
else
|
|
lock(migrateLock)
|
|
{
|
|
using Database database = new();
|
|
database.Database.Migrate();
|
|
}
|
|
}
|
|
} |