Skip to content

Commit b2a3d1a

Browse files
Dmytro ZhariiDmytro Zharii
authored andcommitted
I was not able to use BDDfy in the abstract class because of existing of new() constraint in Given/When/Then fluent extensions. Not the constraint is removed from FluentScannerExtensions.cs
1 parent 4057a22 commit b2a3d1a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

TestStack.BDDfy/Scanners/StepScanners/Fluent/FluentScannerExtensions.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,43 +33,43 @@ namespace TestStack.BDDfy.Scanners.StepScanners.Fluent
3333
{
3434
public static class FluentStepScannerExtensions
3535
{
36-
static IInitialStep<TScenario> Scan<TScenario>(this TScenario testObject) where TScenario : class, new()
36+
static IInitialStep<TScenario> Scan<TScenario>(this TScenario testObject) where TScenario : class
3737
{
3838
return new FluentScanner<TScenario>(testObject);
3939
}
4040

4141
public static IGiven<TScenario> Given<TScenario>(this TScenario testObject, Expression<Action<TScenario>> givenStep, string stepTextTemplate)
42-
where TScenario: class, new()
42+
where TScenario: class
4343
{
4444
return testObject.Scan().Given(givenStep, stepTextTemplate);
4545
}
4646

4747
public static IGiven<TScenario> Given<TScenario>(this TScenario testObject, Expression<Action<TScenario>> givenStep, bool includeInputsInStepTitle)
48-
where TScenario: class, new()
48+
where TScenario: class
4949
{
5050
return testObject.Scan().Given(givenStep, includeInputsInStepTitle);
5151
}
5252

5353
public static IWhen<TScenario> When<TScenario>(this TScenario testObject, Expression<Action<TScenario>> whenStep, string stepTextTemplate)
54-
where TScenario : class, new()
54+
where TScenario : class
5555
{
5656
return testObject.Scan().When(whenStep, stepTextTemplate);
5757
}
5858

5959
public static IWhen<TScenario> When<TScenario>(this TScenario testObject, Expression<Action<TScenario>> whenStep, bool includeInputsInStepTitle)
60-
where TScenario : class, new()
60+
where TScenario : class
6161
{
6262
return testObject.Scan().When(whenStep, includeInputsInStepTitle);
6363
}
6464

6565
public static IGiven<TScenario> Given<TScenario>(this TScenario testObject, Expression<Action<TScenario>> givenStep)
66-
where TScenario: class, new()
66+
where TScenario: class
6767
{
6868
return testObject.Given(givenStep, null);
6969
}
7070

7171
public static IWhen<TScenario> When<TScenario>(this TScenario testObject, Expression<Action<TScenario>> whenStep)
72-
where TScenario : class, new()
72+
where TScenario : class
7373
{
7474
return testObject.When(whenStep, null);
7575
}

0 commit comments

Comments
 (0)