Добавить тест
This commit is contained in:
parent
58346b8f3e
commit
c4b9878105
@ -6,7 +6,7 @@ using System.Collections.Concurrent;
|
||||
using System.Reflection;
|
||||
|
||||
namespace DD.Persistence.Client.Clients.Mapping.Clients;
|
||||
internal class TimestampedMappingClient(ITimestampedValuesClient client, Dictionary<Guid, Type>? mappingConfigs) : ITimestampedMappingClient
|
||||
public class TimestampedMappingClient(ITimestampedValuesClient client, Dictionary<Guid, Type>? mappingConfigs) : ITimestampedMappingClient
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
private readonly ConcurrentDictionary<Guid, TimestampedSetMapperBase> mapperCache = new();
|
||||
|
@ -16,6 +16,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DD.Persistence.Client\DD.Persistence.Client.csproj" />
|
||||
<ProjectReference Include="..\DD.Persistence.Database.Postgres\DD.Persistence.Database.Postgres.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
40
DD.Persistence.Test/MappingClientsTest.cs
Normal file
40
DD.Persistence.Test/MappingClientsTest.cs
Normal file
@ -0,0 +1,40 @@
|
||||
using DD.Persistence.Client.Clients.Interfaces;
|
||||
using DD.Persistence.Client.Clients.Mapping.Abstractions;
|
||||
using DD.Persistence.Client.Clients.Mapping.Clients;
|
||||
using DD.Persistence.Repositories;
|
||||
using DD.Persistence.Services.Interfaces;
|
||||
using NSubstitute;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DD.Persistence.Test;
|
||||
public class MappingClientsTest
|
||||
{
|
||||
private readonly ITimestampedValuesClient timestampedValuesClient = Substitute.For<ITimestampedValuesClient>();
|
||||
private readonly TimestampedMappingClient timestampedMappingClient;
|
||||
public record TestDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? Value { get; set; }
|
||||
}
|
||||
|
||||
private readonly Dictionary<Guid, Type> mappingConfigs = new Dictionary<Guid, Type>()
|
||||
{
|
||||
{ Guid.NewGuid(), typeof(TestDto) }
|
||||
};
|
||||
|
||||
public MappingClientsTest()
|
||||
{
|
||||
timestampedMappingClient = new TimestampedMappingClient(timestampedValuesClient, mappingConfigs);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void Test()
|
||||
{
|
||||
var discriminatorIds = mappingConfigs.Keys;
|
||||
var result = await timestampedMappingClient.Gett(discriminatorIds, null, null, null, 0, 1, CancellationToken.None);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user