public void AddDescription(Description description) { if (!_descriptions.Contains(description)) { _descriptions.Add(description); description.Suite = this; } }
public IEnumerable<Suite> HandleFiles(IEnumerable<IFile> files) { var affectedSuites = new List<Suite>(); foreach (var file in files) { var isSystem = IsSystem(file); if (isSystem) { var suite = new Suite(file); _suites.Add(suite); } var isDescription = IsDescription(file); if (isDescription && _descriptionComponents.ContainsKey(SystemComponentName)) { var systemComponentIndex = _descriptionComponents[SystemComponentName]; foreach (var suite in _suites) { var match = _descriptionsSearchPathRegex.Match(file.FullPath); if (match.Groups[systemComponentIndex+1].Value == suite.System) { var description = new Description(file); // Todo: Hack for now description.AddCase(new Case()); suite.AddDescription(description); if( !affectedSuites.Contains(suite) ) { affectedSuites.Add (suite); } } } } } return affectedSuites; }
void PrintSuiteInformation(Description description) { var descriptionHasFailingCases = description.Cases.Any(c => !Case.IsDummyOrEmptyCase(c) && c.Result.Success == false); if (_options.OnlyOutputFailed && !descriptionHasFailingCases) return; Console.WriteLine(""); Console.WriteLine("for( {0} ) ", description.Suite.FriendlyName()); Console.WriteLine(" describing( {0} ) ", description.FriendlyName()); }
private void PrintDescriptionWithoutExecutedCases(Description description) { if (_options.OnlyOutputFailed) return; Console.WriteLine(" no cases executed for description "); }
bool IsDescriptionForSystem(Description description, Suite suite) { var systemComponents = _systemsSearchPathRegex.Match(suite.SystemFile.FullPath); var descriptionComponents = _descriptionsSearchPathRegex.Match(description.File.FullPath); for (int i = 0; i < _systemComponents.Count(); i++) { var customComponent = _systemComponents.ElementAt(i); var matchIndex = customComponent.Value + 1; if (systemComponents.Groups.Count >= matchIndex && descriptionComponents.Groups.Count >= matchIndex) if (systemComponents.Groups[matchIndex].Value == descriptionComponents.Groups[matchIndex].Value) continue; return false; } return true; }
public IEnumerable<Suite> HandleFiles(IEnumerable<IFile> files) { var affectedSuites = new List<Suite>(); foreach (var file in files) { var isSystem = IsSystem(file); if (isSystem) { var suite = _suites.Where(s => s.SystemFile.FullPath == file.FullPath).SingleOrDefault(); if (suite == null) { suite = new Suite(file); _suites.Add(suite); } if (!affectedSuites.Contains(suite)) affectedSuites.Add(suite); } var isDescription = IsDescription(file); if (isDescription) { var description = new Description(file); _suites.Where(s => IsDescriptionForSystem(description, s)) .ForEach(s => { s.AddDescription(description); if (!affectedSuites.Contains(s)) affectedSuites.Add(s); }); } } return affectedSuites; }
public void AddDescription(Description description) { _descriptions.Add(description); description.Suite = this; }