-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathIFluentStepBuilderExtensions.cs
More file actions
20 lines (17 loc) · 1.06 KB
/
Copy pathIFluentStepBuilderExtensions.cs
File metadata and controls
20 lines (17 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using System.Linq.Expressions;
namespace Ocelot.Acceptance;
public static class IFluentStepBuilderExtensions
{
public static IFluentStepBuilder<TScenario> AndIf<TScenario>(this IFluentStepBuilder<TScenario> scenario, bool when, Expression<Action<TScenario>> step)
where TScenario : class
=> when ? scenario.And(step) : scenario;
public static IFluentStepBuilder<TScenario> AndIfNot<TScenario>(this IFluentStepBuilder<TScenario> scenario, bool when, Expression<Action<TScenario>> step)
where TScenario : class
=> !when ? scenario.And(step) : scenario;
public static IFluentStepBuilder<TScenario> ThenIf<TScenario>(this IFluentStepBuilder<TScenario> scenario, bool when, Expression<Action<TScenario>> step)
where TScenario : class
=> when ? scenario.Then(step) : scenario;
public static IFluentStepBuilder<TScenario> ThenIfNot<TScenario>(this IFluentStepBuilder<TScenario> scenario, bool when, Expression<Action<TScenario>> step)
where TScenario : class
=> !when ? scenario.Then(step) : scenario;
}