Skip to content

Commit 7cc3b19

Browse files
author
Jake Ginnivan
committed
Pulled out a common run method
1 parent bfa2006 commit 7cc3b19

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

TestStack.BDDfy/Scanners/StepScanners/StepActionFactory.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,18 @@ public class StepActionFactory
77
{
88
public static Action<object> GetStepAction(MethodInfo method, object[] inputs)
99
{
10-
return o => method.Invoke(o, inputs);
10+
return o => Run(()=>method.Invoke(o, inputs));
1111
}
1212

1313
public static Action<object> GetStepAction<TScenario>(Action<TScenario> action)
1414
where TScenario : class
1515
{
16-
return o => action((TScenario) o);
16+
return o => Run(() => action((TScenario)o));
17+
}
18+
19+
private static void Run(Action func)
20+
{
21+
func();
1722
}
1823
}
1924
}

0 commit comments

Comments
 (0)