Пример #1
0
        [Test] public void CreateCallableChokesOnNullActionArgument()
        {
            var e = Assert.Throws <ArgumentNullException>(
                () => Executors.CreateCallable((Action)null));

            Assert.That(e.ParamName, Is.EqualTo("action"));
        }
Пример #2
0
        [Test] public void CreateCallableFromActionReturnsNullWhenCalled()
        {
            var action = MockRepository.GenerateMock <Action>();
            var c      = Executors.CreateCallable(action);

            Assert.That(c.Call(), Is.Null);
            action.AssertWasCalled(a => a());
        }
Пример #3
0
        [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());
        }