26ff8d9b4f
Set up repository with legacy .NET Framework 4.8 source (OLD/), new .NET 10 Blazor solution (NEW/), OpenSpec specifications, documentation, and project configuration.
40 lines
1.4 KiB
C#
40 lines
1.4 KiB
C#
using JdeScoping.DataAccess.Interfaces;
|
|
using Oracle.ManagedDataAccess.Client;
|
|
|
|
namespace JdeScoping.DataSync.IntegrationTests.Infrastructure;
|
|
|
|
/// <summary>
|
|
/// Connection factory for integration tests that uses the test container connection string.
|
|
/// </summary>
|
|
public class TestDbConnectionFactory : IDbConnectionFactory
|
|
{
|
|
private readonly string _connectionString;
|
|
|
|
public TestDbConnectionFactory(string connectionString)
|
|
{
|
|
_connectionString = connectionString;
|
|
}
|
|
|
|
public async Task<SqlConnection> CreateLotFinderConnectionAsync(CancellationToken ct = default)
|
|
{
|
|
var connection = new SqlConnection(_connectionString);
|
|
await connection.OpenAsync(ct);
|
|
return connection;
|
|
}
|
|
|
|
public Task<OracleConnection> CreateJdeConnectionAsync(CancellationToken ct = default)
|
|
{
|
|
throw new NotImplementedException("JDE connection not supported in integration tests");
|
|
}
|
|
|
|
public Task<OracleConnection> CreateJdeStageConnectionAsync(CancellationToken ct = default)
|
|
{
|
|
throw new NotImplementedException("JDE Stage connection not supported in integration tests");
|
|
}
|
|
|
|
public Task<OracleConnection> CreateCmsConnectionAsync(CancellationToken ct = default)
|
|
{
|
|
throw new NotImplementedException("CMS connection not supported in integration tests");
|
|
}
|
|
}
|