mirror of
https://github.com/bitwarden/server.git
synced 2024-12-27 17:47:37 +01:00
efe91fd0d8
* Move RevisionDate Bumps to Extension Class * Add Tests against live databases * Run Formatting * Fix Typo * Fix Test Solution Typo * Await ReplaceAsync
37 lines
742 B
C#
37 lines
742 B
C#
using Bit.Infrastructure.EntityFramework.Repositories;
|
|
|
|
namespace Bit.Infrastructure.IntegrationTest;
|
|
|
|
public interface ITestDatabaseHelper
|
|
{
|
|
void ClearTracker();
|
|
}
|
|
|
|
public class EfTestDatabaseHelper : ITestDatabaseHelper
|
|
{
|
|
private readonly DatabaseContext _databaseContext;
|
|
|
|
public EfTestDatabaseHelper(DatabaseContext databaseContext)
|
|
{
|
|
_databaseContext = databaseContext;
|
|
}
|
|
|
|
public void ClearTracker()
|
|
{
|
|
_databaseContext.ChangeTracker.Clear();
|
|
}
|
|
}
|
|
|
|
public class DapperSqlServerTestDatabaseHelper : ITestDatabaseHelper
|
|
{
|
|
public DapperSqlServerTestDatabaseHelper()
|
|
{
|
|
|
|
}
|
|
|
|
public void ClearTracker()
|
|
{
|
|
// There are no tracked entities in Dapper SQL Server
|
|
}
|
|
}
|