public void it_should_call_an_action_with_no_params() { string enclosed = "hello"; Action action = () => { enclosed = "goodbye"; }; var caller = new nStep.Core.ActionCaller(action); caller.Call(); enclosed.Should().Be.EqualTo("goodbye"); }
public void it_should_call_an_action_with_2_params() { string enclosed = "hello"; Action<string,string> action = (foo, bar) => { enclosed = foo + bar; }; var caller = new nStep.Core.ActionCaller(action, "bob", "o"); caller.Call(); enclosed.Should().Be.EqualTo("bobo"); }
public void it_should_throw_an_NStepInvocationException() { Action action = () => { throw new InvalidTimeZoneException(); }; var caller = new nStep.Core.ActionCaller(action); new Action(() => caller.Call()).Should().Throw<NStepInvocationException>(); }