private Regex AssertRegex(string regexText) { regexText.Should().NotBeNullOrWhiteSpace("null, empty or whitespace-only regex is not valid for step definitions"); return(RegexFactory.Create(regexText)); // uses the same regex creation as real step definitions }