using JdeScoping.DataAccess.Interfaces;
using Oracle.ManagedDataAccess.Client;
namespace JdeScoping.DataSync.IntegrationTests.Infrastructure;
///
/// Connection factory for integration tests that uses the test container connection string.
///
public class TestDbConnectionFactory : IDbConnectionFactory
{
private readonly string _connectionString;
public TestDbConnectionFactory(string connectionString)
{
_connectionString = connectionString;
}
public async Task CreateLotFinderConnectionAsync(CancellationToken ct = default)
{
var connection = new SqlConnection(_connectionString);
await connection.OpenAsync(ct);
return connection;
}
public Task CreateJdeConnectionAsync(CancellationToken ct = default)
{
throw new NotImplementedException("JDE connection not supported in integration tests");
}
public Task CreateJdeStageConnectionAsync(CancellationToken ct = default)
{
throw new NotImplementedException("JDE Stage connection not supported in integration tests");
}
public Task CreateCmsConnectionAsync(CancellationToken ct = default)
{
throw new NotImplementedException("CMS connection not supported in integration tests");
}
}