Backend/e-suite.Service.EFlowSync/e-suite.Service.EFlowSync.UnitTests/FakeRepositories/FakeEFlowSyncRepository.cs
2026-01-20 21:50:10 +00:00

23 lines
844 B
C#

using e_suite.Service.EFlowSync.Repository;
using e_suite.UnitTestCore;
namespace e_suite.Service.EFlowSync.UnitTests.FakeRepositories;
public class FakeEFlowSyncRepository : FakeRepository, IEFlowSyncRepository
{
public Dictionary<(string, string), string> ExternalIds = new();
public Task<string?> GetEFlowExternalId(string entityName, string primaryKeyJson)
{
if (ExternalIds.ContainsKey((entityName, primaryKeyJson)))
return Task.FromResult(ExternalIds[(entityName, primaryKeyJson)])!;
return Task.FromResult<string?>(null);
}
public Task AddEflowExternalId(string entityName, string primaryKeyJson, string childId, CancellationToken cancellationToken)
{
ExternalIds[(entityName, primaryKeyJson)] = childId;
return Task.CompletedTask;
}
}