fix(git-tests): Create per-test specific databases
This commit is contained in:
parent
cb01efd323
commit
cf782211aa
3 changed files with 40 additions and 6 deletions
|
|
@ -17,6 +17,8 @@ public class GitManager
|
|||
private GitManager(string? databaseName = null)
|
||||
{
|
||||
_registrations = new ConcurrentDictionary<string, InternalGitRegistration>();
|
||||
// Regular usage of this constructor will never pass a database name in. Currently only tests should be hitting
|
||||
// a code path that has a different database name
|
||||
_db = new DatabaseManager(databaseName ?? "git.db");
|
||||
|
||||
InitialiseRegistrations();
|
||||
|
|
@ -29,6 +31,14 @@ public class GitManager
|
|||
/// </summary>
|
||||
internal static GitManager InternalFreshInstance(string databaseName) => new(databaseName);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes the underlying database file.
|
||||
/// <para>
|
||||
/// Avoid calling this outside of tests.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
internal void DeleteDatabase() => _db.DeleteDatabase();
|
||||
|
||||
/// <summary>
|
||||
/// Creates up any database tables and loads all previously saved git registrations.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Reference in a new issue