[Test] public void CreateCallableChokesOnNullActionArgument() { var e = Assert.Throws <ArgumentNullException>( () => Executors.CreateCallable((Action)null)); Assert.That(e.ParamName, Is.EqualTo("action")); }
[Test] public void CreateCallableFromActionReturnsNullWhenCalled() { var action = MockRepository.GenerateMock <Action>(); var c = Executors.CreateCallable(action); Assert.That(c.Call(), Is.Null); action.AssertWasCalled(a => a()); }
[Test] public void CreateCallableFromRunnableReturnsNullWhenCalled() { var runnable = MockRepository.GenerateMock <IRunnable>(); var c = Executors.CreateCallable(runnable); Assert.That(c.Call(), Is.Null); runnable.AssertWasCalled(r => r.Run()); }