public async void Should_unblock_one_or_more_delays()
 {
     var task = Task.Run(() => {
         TimeMachine.UnblockOneOrMoreDelays();
     });
     await TimeMachine.Delay(10000000);
 }
Esempio n. 2
0
 public void Should_not_notify_save_when_not_dirty()
 {
     using (var sem = new Semaphore(0, 1)) {
         var saveCalled = false;
         var strategy   = new BackgroundSave(TimeSpan.FromSeconds(10));
         strategy.NotifyUnsolicitedSave += (sender, args) => {
             saveCalled = true;
             sem.Release();
         };
         TimeMachine.UnblockOneOrMoreDelays();
         sem.WaitOne(100);
         Assert.False(saveCalled);
     }
 }