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.
This commit is contained in:
+37
@@ -0,0 +1,37 @@
|
||||
using System.Data;
|
||||
using JdeScoping.DataSync.Contracts;
|
||||
using JdeScoping.DataSync.Generated;
|
||||
|
||||
namespace JdeScoping.DataSync.IntegrationTests.Infrastructure;
|
||||
|
||||
/// <summary>
|
||||
/// DataReaderFactory for integration tests that supports both test entities and production entities.
|
||||
/// </summary>
|
||||
public class TestDataReaderFactory : IDataReaderFactory
|
||||
{
|
||||
private readonly DataReaderFactory _innerFactory = new();
|
||||
|
||||
public IDataReader CreateReader<T>(IAsyncEnumerable<T> source) where T : class
|
||||
{
|
||||
// Handle test entity
|
||||
if (typeof(T) == typeof(BulkMergeTestEntity))
|
||||
{
|
||||
return new BulkMergeTestEntityDataReader((IAsyncEnumerable<BulkMergeTestEntity>)(object)source);
|
||||
}
|
||||
|
||||
// Delegate to production factory for other types
|
||||
return _innerFactory.CreateReader(source);
|
||||
}
|
||||
|
||||
public IReadOnlyList<string> GetColumnNames<T>() where T : class
|
||||
{
|
||||
// Handle test entity
|
||||
if (typeof(T) == typeof(BulkMergeTestEntity))
|
||||
{
|
||||
return BulkMergeTestEntityDataReader.GetColumnNames();
|
||||
}
|
||||
|
||||
// Delegate to production factory for other types
|
||||
return _innerFactory.GetColumnNames<T>();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user