mirror of
https://github.com/bitwarden/server.git
synced 2025-06-07 03:30:32 -05:00

Adds a SqlServerApiApplicationFactory which allows you to run api tests using SqlServer. Currently a new database is create and destroyed for each test. In the future we'd like a more optimized way to do this. The database logic is abstracted away in a ITestDatabase interface which handles the configuration, migration and teardown.
20 lines
435 B
C#
20 lines
435 B
C#
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace Bit.IntegrationTestCommon;
|
|
|
|
#nullable enable
|
|
|
|
public interface ITestDatabase
|
|
{
|
|
public void AddDatabase(IServiceCollection serviceCollection);
|
|
|
|
public void Migrate(IServiceCollection serviceCollection);
|
|
|
|
public void Dispose();
|
|
|
|
public void ModifyGlobalSettings(Dictionary<string, string?> config)
|
|
{
|
|
// Default implementation does nothing
|
|
}
|
|
}
|