Skip to content

Commit

Permalink
Fix build warning
Browse files Browse the repository at this point in the history
  • Loading branch information
ejsmith committed Feb 9, 2025
1 parent f446173 commit 208ceab
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ public sealed class CustomFieldTests : ElasticRepositoryTestBase
{
private readonly ICustomFieldDefinitionRepository _customFieldDefinitionRepository;
private readonly IEmployeeWithCustomFieldsRepository _employeeRepository;
private readonly InMemoryCacheClient _cache;
private readonly InMemoryCacheClient _repocache;

public CustomFieldTests(ITestOutputHelper output) : base(output)
{
_customFieldDefinitionRepository = _configuration.CustomFieldDefinitionRepository;
_employeeRepository = new EmployeeWithCustomFieldsRepository(_configuration);
_cache = _configuration.Cache as InMemoryCacheClient;
_repocache = _configuration.Cache as InMemoryCacheClient;
}

public override async Task InitializeAsync()
Expand Down Expand Up @@ -87,11 +87,11 @@ public async Task CanAddNewFieldsAndReserveSlots()
IndexType = "string"
});
Assert.Equal(1, customField.IndexSlot);
Assert.Equal(3, _cache.Count);
Assert.Equal(3, _repocache.Count);
var mapping = await _customFieldDefinitionRepository.GetFieldMappingAsync(nameof(EmployeeWithCustomFields), "1");
Assert.Contains(mapping.Keys, c => c == "MyField1");
await _customFieldDefinitionRepository.GetFieldMappingAsync(nameof(EmployeeWithCustomFields), "1");
Assert.Equal(1, _cache.Hits);
Assert.Equal(1, _repocache.Hits);

customField = await _customFieldDefinitionRepository.AddAsync(new CustomFieldDefinition
{
Expand All @@ -103,7 +103,7 @@ public async Task CanAddNewFieldsAndReserveSlots()
Assert.Equal(2, customField.IndexSlot);
mapping = await _customFieldDefinitionRepository.GetFieldMappingAsync(nameof(EmployeeWithCustomFields), "1");
Assert.Contains(mapping.Keys, c => c == "MyField2");
Assert.Equal(3, _cache.Hits);
Assert.Equal(3, _repocache.Hits);

customField = await _customFieldDefinitionRepository.AddAsync(new CustomFieldDefinition
{
Expand All @@ -115,7 +115,7 @@ public async Task CanAddNewFieldsAndReserveSlots()
Assert.Equal(3, customField.IndexSlot);
mapping = await _customFieldDefinitionRepository.GetFieldMappingAsync(nameof(EmployeeWithCustomFields), "1");
Assert.Contains(mapping.Keys, c => c == "MyField3");
Assert.Equal(5, _cache.Hits);
Assert.Equal(5, _repocache.Hits);
}

[Fact]
Expand Down

0 comments on commit 208ceab

Please sign in to comment.