diff --git a/src/TestStack.BDDfy/Step.cs b/src/TestStack.BDDfy/Step.cs index ac331ed..444af43 100644 --- a/src/TestStack.BDDfy/Step.cs +++ b/src/TestStack.BDDfy/Step.cs @@ -6,11 +6,11 @@ namespace TestStack.BDDfy { public class Step { - private readonly StepTitle _title; - + private readonly StepTitle _stepTitle; + private string _title; public Step( Func action, - StepTitle title, + StepTitle stepTitle, bool asserts, ExecutionOrder executionOrder, bool shouldReport, @@ -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; @@ -42,16 +42,8 @@ public Step(Step step) internal Func 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; } diff --git a/src/TestStack.BDDfy/StepTitle.cs b/src/TestStack.BDDfy/StepTitle.cs index d3e8dae..64250e5 100644 --- a/src/TestStack.BDDfy/StepTitle.cs +++ b/src/TestStack.BDDfy/StepTitle.cs @@ -6,10 +6,7 @@ public class StepTitle { private readonly Func _createTitle; - public StepTitle(string title) - { - _createTitle = () => title; - } + public StepTitle(string title) => _createTitle = () => title; public StepTitle(Func createTitle) {