The core infrastructure backend (API, database, Docker, etc).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

36 lines
742 B

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
}
}