Skip to content

Commit

Permalink
Improve TestFolders by generating a name from the examples for scenar…
Browse files Browse the repository at this point in the history
…io outlines
  • Loading branch information
gasparnagy committed Jun 20, 2022
1 parent fc92ada commit 98082eb
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections;
using System.Globalization;
using System.IO;
using System.Reflection;
Expand Down Expand Up @@ -79,7 +80,15 @@ public string ToPath(string s)

public string GetScenarioSpecificFileName(string extension = "")
{
return $"{ToPath(_featureContext.FeatureInfo.Title)}_{ToPath(_scenarioContext.ScenarioInfo.Title)}_{DateTime.Now.Ticks}" + extension;
var baseFileName = $"{ToPath(_featureContext.FeatureInfo.Title)}_{ToPath(_scenarioContext.ScenarioInfo.Title)}";
if (_scenarioContext.ScenarioInfo.Arguments != null && _scenarioContext.ScenarioInfo.Arguments.Count > 0)
{
foreach (DictionaryEntry entry in _scenarioContext.ScenarioInfo.Arguments)
{
baseFileName += $"_{entry.Key}-{entry.Value}";
}
}
return baseFileName + extension;
}
}
}

0 comments on commit 98082eb

Please sign in to comment.