public void OnceAction_IsRemoved_AfterRunningOnce() { OnceAction once = SelectThe <OnceAction>(); RepeatAction repeat = SelectThe <RepeatAction>(); raiser.Raise(null, new EventArgs()); Assert.That(scheduler.Actions.Contains(once), Is.False); }
public void CanRunOnce() { OnceAction once = SelectThe <OnceAction>(); RepeatAction repeat = SelectThe <RepeatAction>(); raiser.Raise(null, new EventArgs()); Assert.That(once.executions, Is.EqualTo(1)); Assert.That(repeat.executions, Is.EqualTo(1)); }
public void WillCatchErrors_AndContinueExecution_OfOtherActions() { var ex = new NullReferenceException("Bad bad"); scheduler.Actions.Insert(0, new ThrowingAction { ExceptionToThrow = ex }); OnceAction once = SelectThe <OnceAction>(); RepeatAction repeat = SelectThe <RepeatAction>(); mocks.BackToRecord(errorHandler); //errorHandler.Notify(ex); // wayne: custom error handler called instead of the error mocks.ReplayAll(); raiser.Raise(null, new EventArgs()); Assert.That(once.executions, Is.EqualTo(1)); Assert.That(repeat.executions, Is.EqualTo(1)); }