mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-27 05:52:51 +08:00

* 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>
36 lines
991 B
C#
36 lines
991 B
C#
namespace Ocelot.UnitTests.Configuration.ChangeTracking
|
|
{
|
|
using Ocelot.Configuration.ChangeTracking;
|
|
using Shouldly;
|
|
using TestStack.BDDfy;
|
|
using Xunit;
|
|
|
|
public class OcelotConfigurationChangeTokenSourceTests
|
|
{
|
|
private readonly IOcelotConfigurationChangeTokenSource _source;
|
|
|
|
public OcelotConfigurationChangeTokenSourceTests()
|
|
{
|
|
_source = new OcelotConfigurationChangeTokenSource();
|
|
}
|
|
|
|
[Fact]
|
|
public void should_activate_change_token()
|
|
{
|
|
this.Given(_ => GivenIActivateTheChangeTokenSource())
|
|
.Then(_ => ThenTheChangeTokenShouldBeActivated())
|
|
.BDDfy();
|
|
}
|
|
|
|
private void GivenIActivateTheChangeTokenSource()
|
|
{
|
|
_source.Activate();
|
|
}
|
|
|
|
private void ThenTheChangeTokenShouldBeActivated()
|
|
{
|
|
_source.ChangeToken.HasChanged.ShouldBeTrue();
|
|
}
|
|
}
|
|
}
|