Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions src/TestStack.BDDfy/Step.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ namespace TestStack.BDDfy
{
public class Step
{
private readonly StepTitle _title;

private readonly StepTitle _stepTitle;
private string _title;
public Step(
Func<object, object> action,
StepTitle title,
StepTitle stepTitle,
bool asserts,
ExecutionOrder executionOrder,
bool shouldReport,
Expand All @@ -23,13 +23,13 @@ public Step(
Result = Result.NotExecuted;
Action = action;
Arguments = arguments;
_title = title;
_stepTitle = stepTitle;
}

public Step(Step step)
{
Id = step.Id;
_title = step._title;
_stepTitle = step._stepTitle;
Asserts = step.Asserts;
ExecutionOrder = step.ExecutionOrder;
ShouldReport = step.ShouldReport;
Expand All @@ -42,16 +42,8 @@ public Step(Step step)
internal Func<object, object> Action { get; set; }
public bool Asserts { get; private set; }
public bool ShouldReport { get; private set; }
public string Title
{
get
{
return _title.ToString();
}
}

public string Title => _title??= _stepTitle;
public ExecutionOrder ExecutionOrder { get; private set; }

public Result Result { get; set; }
public Exception Exception { get; set; }
public int ExecutionSubOrder { get; set; }
Expand Down
5 changes: 1 addition & 4 deletions src/TestStack.BDDfy/StepTitle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ public class StepTitle
{
private readonly Func<string> _createTitle;

public StepTitle(string title)
{
_createTitle = () => title;
}
public StepTitle(string title) => _createTitle = () => title;

public StepTitle(Func<string> createTitle)
{
Expand Down
Loading