Exemplo n.º 1
0
 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");
 }
Exemplo n.º 2
0
 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");
 }
Exemplo n.º 3
0
 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>();
 }