public void OneTimeRunner_Should_Run_Once() { var oneTimeRunner = new OneTimeRunner(); var count = 0; for (int i = 0; i < 10; i++) { oneTimeRunner.Run(() => { count++; }); } count.ShouldBe(1); }
public DynamicOptionsProvider(IOptions <TValue> options) { _oneTimeRunner = new OneTimeRunner(); _lazyValueFactory = new Lazy <TValue>(() => CreateOptions(options)); }