Skip to content

Commit 9dea591

Browse files
committed
using Configurator.Humanize instead of NetToString everywhere
1 parent 3873bfd commit 9dea591

6 files changed

Lines changed: 11 additions & 7 deletions

File tree

TestStack.BDDfy/Scanners/ScenarioScanners/FluentScenarioScanner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ private static string GetTitleFromMethodNameInStackTrace(object testObject)
4545
if (initiatingFrame == null)
4646
return null;
4747

48-
return NetToString.Convert(initiatingFrame.GetMethod().Name);
48+
return Configurator.Scanners.Humanize(initiatingFrame.GetMethod().Name);
4949
}
5050
}
5151
}

TestStack.BDDfy/Scanners/ScenarioScanners/ReflectiveScenarioScanner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public virtual IEnumerable<Scenario> Scan(ITestContext testContext)
5151

5252
static string GetScenarioText(Type scenarioType)
5353
{
54-
return NetToString.Convert(scenarioType.Name);
54+
return Configurator.Scanners.Humanize(scenarioType.Name);
5555
}
5656

5757
protected virtual IEnumerable<Step> ScanScenarioForSteps(ITestContext testContext)

TestStack.BDDfy/Scanners/StepScanners/ExecutableAttribute/ExecutableAttributeStepScanner.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Linq;
33
using System.Reflection;
44
using System.Text.RegularExpressions;
5+
using TestStack.BDDfy.Configuration;
56

67
namespace TestStack.BDDfy
78
{
@@ -33,7 +34,7 @@ public IEnumerable<Step> Scan(ITestContext testContext, MethodInfo candidateMeth
3334

3435
var stepTitle = new StepTitle(executableAttribute.StepTitle);
3536
if(string.IsNullOrEmpty(stepTitle))
36-
stepTitle = new StepTitle(NetToString.Convert(candidateMethod.Name));
37+
stepTitle = new StepTitle(Configurator.Scanners.Humanize(candidateMethod.Name));
3738

3839
var stepAsserts = IsAssertingByAttribute(candidateMethod);
3940

@@ -76,7 +77,7 @@ public IEnumerable<Step> Scan(ITestContext testContext, MethodInfo method, Examp
7677

7778
string stepTitle = executableAttribute.StepTitle;
7879
if (string.IsNullOrEmpty(stepTitle))
79-
stepTitle = NetToString.Convert(method.Name);
80+
stepTitle = Configurator.Scanners.Humanize(method.Name);
8081

8182
var stepAsserts = IsAssertingByAttribute(method);
8283
var methodParameters = method.GetParameters();

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Reflection;
55
using System.Linq;
66
using System.Threading.Tasks;
7+
using TestStack.BDDfy.Configuration;
78

89
namespace TestStack.BDDfy
910
{
@@ -136,7 +137,7 @@ private StepTitle CreateTitle(string stepTextTemplate, bool includeInputsInStepT
136137
{
137138

138139
var flatInputArray = inputArguments.FlattenArrays();
139-
var stepTitle = NetToString.Convert(methodInfo.Name);
140+
var stepTitle = Configurator.Scanners.Humanize(methodInfo.Name);
140141

141142
if (!string.IsNullOrEmpty(stepTextTemplate)) stepTitle = string.Format(stepTextTemplate, flatInputArray);
142143
else if (includeInputsInStepTitle)

TestStack.BDDfy/Scanners/StepScanners/MethodName/MethodNameStepScanner.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.Reflection;
44
using System.Linq;
5+
using TestStack.BDDfy.Configuration;
56

67
namespace TestStack.BDDfy
78
{
@@ -122,7 +123,7 @@ private string GetStepTitle(MethodInfo method, object testObject, RunStepWithArg
122123

123124
private string GetStepTitleFromMethodName(MethodInfo method, RunStepWithArgsAttribute argAttribute)
124125
{
125-
var methodName = _stepTextTransformer(NetToString.Convert(method.Name));
126+
var methodName = _stepTextTransformer(Configurator.Scanners.Humanize(method.Name));
126127
object[] inputs = null;
127128

128129
if (argAttribute != null && argAttribute.InputArguments != null)

TestStack.BDDfy/Scanners/StoryMetadata.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using TestStack.BDDfy.Configuration;
23

34
namespace TestStack.BDDfy
45
{
@@ -11,7 +12,7 @@ public StoryMetadata(Type storyType, StoryNarrativeAttribute narrative)
1112

1213
public StoryMetadata(Type storyType, string narrative1, string narrative2, string narrative3, string title = null, string titlePrefix = null)
1314
{
14-
Title = title ?? NetToString.Convert(storyType.Name);
15+
Title = title ?? Configurator.Scanners.Humanize(storyType.Name);
1516
TitlePrefix = titlePrefix ?? "Story: ";
1617
Type = storyType;
1718

0 commit comments

Comments
 (0)