Files
jdescopingtool/NEW/tests/JdeScoping.DataSync.IntegrationTests/Infrastructure/TestDbConnectionFactory.cs
T
Joseph Doherty 26ff8d9b4f Initial commit: JDE Scoping Tool migration project
Set up repository with legacy .NET Framework 4.8 source (OLD/),
new .NET 10 Blazor solution (NEW/), OpenSpec specifications,
documentation, and project configuration.
2026-01-02 07:43:29 -05:00

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");
}
}