Skip to content

Commit 7609961

Browse files
author
Gurpreet Singh
committed
fix mis placed method
1 parent 00438a4 commit 7609961

File tree

11 files changed

+25
-15
lines changed

11 files changed

+25
-15
lines changed

readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
![Build Status](https://github.com/TestStack/TestStack.BDDfy/actions/workflows/build.yml/badge.svg)
2+
13
BDDfy is the simplest BDD framework to use, customize and extend!
24

35
A few quick facts about BDDfy:

src/TestStack.BDDfy/Abstractions/DefaultStepTitleFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public StepTitle Create(
2828
includeInputsInStepTitle = titleAttribute.IncludeInputsInStepTitle.Value;
2929
}
3030

31-
var stepTitle = AppendPrefix(Configurator.Humanize(name), stepPrefix);
31+
var stepTitle = AppendPrefix(Configurator.Humanizer.Humanize(name), stepPrefix);
3232

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

src/TestStack.BDDfy/BDDfyExtensions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static Story BDDfy(
2020
string caller = null)
2121
{
2222
var callerName = testObject.GetActualCallerName(caller);
23-
return InternalLazyBDDfy(testObject, scenarioTitle ?? Configurator.Humanize(callerName)).Run();
23+
return InternalLazyBDDfy(testObject, scenarioTitle ?? Configurator.Humanizer.Humanize(callerName)).Run();
2424
}
2525

2626
public static Engine LazyBDDfy(
@@ -30,7 +30,7 @@ public static Engine LazyBDDfy(
3030
string caller = null)
3131
{
3232
var callerName = testObject.GetActualCallerName(caller);
33-
return InternalLazyBDDfy(testObject, scenarioTitle ?? Configurator.Humanize(callerName));
33+
return InternalLazyBDDfy(testObject, scenarioTitle ?? Configurator.Humanizer.Humanize(callerName));
3434
}
3535

3636
/// <summary>
@@ -49,7 +49,7 @@ public static Story BDDfy<TStory>(
4949
where TStory : class
5050
{
5151
var callerName = testObject.GetActualCallerName(caller);
52-
return InternalLazyBDDfy(testObject, scenarioTitle ?? Configurator.Humanize(callerName), typeof(TStory)).Run();
52+
return InternalLazyBDDfy(testObject, scenarioTitle ?? Configurator.Humanizer.Humanize(callerName), typeof(TStory)).Run();
5353
}
5454

5555
public static Engine LazyBDDfy<TStory>(
@@ -60,7 +60,7 @@ public static Engine LazyBDDfy<TStory>(
6060
where TStory : class
6161
{
6262
var callerName = testObject.GetActualCallerName(caller);
63-
return InternalLazyBDDfy(testObject, scenarioTitle ?? Configurator.Humanize(callerName), typeof(TStory));
63+
return InternalLazyBDDfy(testObject, scenarioTitle ?? Configurator.Humanizer.Humanize(callerName), typeof(TStory));
6464
}
6565

6666
static Engine InternalLazyBDDfy(

src/TestStack.BDDfy/Configuration/Configurator.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,5 @@ public static class Configurator
2222
public static IFluentScannerFactory FluentScannerFactory { get; set; } = new DefaultFluentScannerFactory();
2323

2424
public static IStepTitleFactory StepTitleFactory { get; set; } = new DefaultStepTitleFactory();
25-
26-
public static string Humanize(string text) => Humanizer.Humanize(text);
2725
}
2826
}

src/TestStack.BDDfy/Configuration/Scanners.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,8 @@ public IEnumerable<IStepScanner> GetStepScanners(object objectUnderTest)
3636
}
3737

3838
public Func<IStoryMetadataScanner> StoryMetadataScanner = () => new StoryAttributeMetadataScanner();
39+
40+
[Obsolete("This will be removed soon. Use Configurator.Humanizer.Humanize")]
41+
public Func<string, string> Humanize = Configurator.Humanizer.Humanize;
3942
}
4043
}

src/TestStack.BDDfy/Reporters/TextReporter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ void ReportOnStep(Scenario scenario, Tuple<Step, string[]> stepAndLines, bool in
170170
}
171171

172172
var step = stepAndLines.Item1;
173-
var humanizedResult = Configurator.Humanize(step.Result.ToString());
173+
var humanizedResult = Configurator.Humanizer.Humanize(step.Result.ToString());
174174

175175
string message;
176176
if (scenario.Result == Result.Passed)

src/TestStack.BDDfy/Scanners/ScenarioScanners/ReflectiveScenarioScanner.cs

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

4848
static string GetScenarioText(Type scenarioType)
4949
{
50-
return Configurator.Humanize(scenarioType.Name);
50+
return Configurator.Humanizer.Humanize(scenarioType.Name);
5151
}
5252

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

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public IEnumerable<Step> Scan(ITestContext testContext, MethodInfo candidateMeth
3535

3636
var stepTitle = new StepTitle(executableAttribute.StepTitle);
3737
if (string.IsNullOrWhiteSpace(stepTitle))
38-
stepTitle = new StepTitle(Configurator.Humanize(candidateMethod.Name));
38+
stepTitle = new StepTitle(Configurator.Humanizer.Humanize(candidateMethod.Name));
3939

4040
var shouldReport = executableAttribute.ShouldReport;
4141

@@ -89,7 +89,7 @@ public IEnumerable<Step> Scan(ITestContext testContext, MethodInfo method, Examp
8989

9090
string stepTitle = executableAttribute.StepTitle;
9191
if (string.IsNullOrWhiteSpace(stepTitle))
92-
stepTitle = Configurator.Humanize(method.Name);
92+
stepTitle = Configurator.Humanizer.Humanize(method.Name);
9393

9494
var shouldReport = executableAttribute.ShouldReport;
9595
var methodParameters = method.GetParameters();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ private string GetStepTitle(MethodInfo method, object testObject, RunStepWithArg
135135

136136
private string GetStepTitleFromMethodName(MethodInfo method, RunStepWithArgsAttribute argAttribute)
137137
{
138-
var methodName = _stepTextTransformer(Configurator.Humanize(method.Name));
138+
var methodName = _stepTextTransformer(Configurator.Humanizer.Humanize(method.Name));
139139
object[] inputs = null;
140140

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

src/TestStack.BDDfy/Scanners/StoryMetadata.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public StoryMetadata(Type storyType, StoryNarrativeAttribute narrative)
1111
}
1212

1313
public Type Type { get; private set; } = storyType;
14-
public string Title { get; private set; } = title ?? Configurator.Humanize(storyType.Name);
14+
public string Title { get; private set; } = title ?? Configurator.Humanizer.Humanize(storyType.Name);
1515
public string TitlePrefix { get; private set; } = titlePrefix ?? "Story: ";
1616
public string Narrative1 { get; private set; } = narrative1;
1717
public string Narrative2 { get; private set; } = narrative2;

0 commit comments

Comments
 (0)