private bool ScenarioOutlineExampleIsMatch(assembliesAssemblyCollectionTest exampleElement, Regex signature) { var testNameWithExample = exampleElement.name; var testNameOnly = testNameWithExample.Split('(')[0]; testNameWithExample = testNameWithExample.Replace(testNameOnly, Regex.Replace(testNameOnly, @"\s+", string.Empty)); return(signature.IsMatch(exampleElement.name) || signature.IsMatch(testNameWithExample)); }
private bool ScenarioOutlineExampleIsMatch(assembliesAssemblyCollectionTest exampleElement, Regex signature) { // split scenario outline title to name + parameters var nameAndArgumentsSplitter = new Regex(@"^(?<name>(.*))(\(.*\))$", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.Compiled); var groups = nameAndArgumentsSplitter.Match(exampleElement.name).Groups; var scenarioName = groups["name"].Value; var scenariotNameWithNoSpacesAndSpecialCharacters = exampleElement.name.Replace(scenarioName, exampleElement.method); var esc = Regex.Escape("\""); var escapedScenariotNameWithNoSpacesAndSpecialCharacters = scenariotNameWithNoSpacesAndSpecialCharacters.Replace(@"\\""", "\"").Replace(@"\""", esc); var escapedExampleElementName = exampleElement.name.Replace(@"\\""", "\"").Replace(@"\""", esc); var escapedSignature = signature.ToString().Replace(@"\""", esc); return(Regex.IsMatch(escapedExampleElementName, escapedSignature, RegexOptions.IgnoreCase) || Regex.IsMatch(escapedScenariotNameWithNoSpacesAndSpecialCharacters, escapedSignature, RegexOptions.IgnoreCase)); }
private TestResult GetResultFromElement(assembliesAssemblyCollectionTest element) { TestResult result; switch (element.result.ToLowerInvariant()) { case "pass": result = TestResult.Passed; break; case "fail": result = TestResult.Failed; break; case "skip": default: result = TestResult.Inconclusive; break; } return(result); }
private bool ScenarioOutlineExampleIsMatch(assembliesAssemblyCollectionTest exampleElement, Regex signature) { return signature.IsMatch(exampleElement.name.ToLowerInvariant()); }
private static bool HasTraitWithValue(assembliesAssemblyCollectionTest test, string trait, string value) { return(test.traits != null && test.traits.Any(t => t.name == trait && t.value == value)); }
private static bool HasFeatureTitleTrait(assembliesAssemblyCollectionTest test, string featureTitle) { return(HasTraitWithValue(test, "FeatureTitle", featureTitle)); }
private static bool HasDescriptionTrait(assembliesAssemblyCollectionTest test, string description) { return(HasTraitWithValue(test, "Description", description)); }
private bool ScenarioOutlineExampleIsMatch(assembliesAssemblyCollectionTest exampleElement, Regex signature) { return(signature.IsMatch(exampleElement.name.ToLowerInvariant())); }
private static bool HasTraitWithValue(assembliesAssemblyCollectionTest test, string trait, string value) { return test.traits != null && test.traits.Any(t => t.name == trait && t.value == value); }
private static bool HasFeatureTitleTrait(assembliesAssemblyCollectionTest test, string featureTitle) { return HasTraitWithValue(test, "FeatureTitle", featureTitle); }
private static bool HasDescriptionTrait(assembliesAssemblyCollectionTest test, string description) { return HasTraitWithValue(test, "Description", description); }
private TestResult GetResultFromElement(assembliesAssemblyCollectionTest element) { TestResult result; switch (element.result.ToLowerInvariant()) { case "pass": result = TestResult.Passed; break; case "fail": result = TestResult.Failed; break; case "skip": default: result = TestResult.Inconclusive; break; } return result; }