mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-19 19:38:16 +08:00
Activate ChangeToken when Ocelot's configuration changes #1037
* Add configuration change token (#1036) * Add IOptionsMonitor<IInternalConfiguration> * Activate change token from *ConfigurationRepository instead of FileAndInternalConfigurationSetter; add acceptance & integration tests * Update documentation * Use IWebHostEnvironment as IHostingEnvironment deprecated Co-authored-by: Chris Swinchatt <chrisswinchatt@gmail.com>
This commit is contained in:
@ -9,6 +9,7 @@ using Ocelot.Errors;
|
||||
using Ocelot.Responses;
|
||||
using Shouldly;
|
||||
using System.Collections.Generic;
|
||||
using Ocelot.Configuration.ChangeTracking;
|
||||
using TestStack.BDDfy;
|
||||
using Xunit;
|
||||
|
||||
@ -21,7 +22,7 @@ namespace Ocelot.UnitTests.Configuration
|
||||
private Mock<IInternalConfigurationRepository> _configRepo;
|
||||
private Mock<IInternalConfigurationCreator> _configCreator;
|
||||
private Response<IInternalConfiguration> _configuration;
|
||||
private object _result;
|
||||
private object _result;
|
||||
private Mock<IFileConfigurationRepository> _repo;
|
||||
|
||||
public FileConfigurationSetterTests()
|
||||
@ -104,8 +105,7 @@ namespace Ocelot.UnitTests.Configuration
|
||||
|
||||
private void ThenTheConfigurationRepositoryIsCalledCorrectly()
|
||||
{
|
||||
_configRepo
|
||||
.Verify(x => x.AddOrReplace(_configuration.Data), Times.Once);
|
||||
_configRepo.Verify(x => x.AddOrReplace(_configuration.Data), Times.Once);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user