private List <IServiceTestCoverageModelTo> GetReportList(string resourceTestDirectory) { var serviceTestCoverageModelTos = new List <IServiceTestCoverageModelTo>(); var files = _directoryWrapper.GetFiles(resourceTestDirectory); foreach (var file in files) { var exists = _fileWrapper.Exists(file.Replace(EnvironmentVariables.TestCoveragePath, EnvironmentVariables.TestPath).Replace(".coverage", ".test")); if (!exists) { _fileWrapper.Delete(file); continue; } try { var reader = new StreamReader(file); var testModel = _serializer.Deserialize <ServiceTestCoverageModelTo>(reader); serviceTestCoverageModelTos.Add(testModel); } catch (Exception e) { Dev2Logger.Warn($"failed loading test: {file} {e.GetType().Name}: " + e.Message, GlobalConstants.WarewolfWarn); } } return(serviceTestCoverageModelTos); }
List <IServiceTestModelTO> GetTestList(string resourceTestDirectory) { var serviceTestModelTos = new List <IServiceTestModelTO>(); var files = _directoryWrapper.GetFiles(resourceTestDirectory); foreach (var file in files) { var reader = new StreamReader(file); var testModel = _serializer.Deserialize <IServiceTestModelTO>(reader); serviceTestModelTos.Add(testModel); } return(serviceTestModelTos); }
/// <summary> /// Collects all files located under specified path and stores them in <seealso cref="FileComponent"/> object. /// Only results matching specified regular expression are gathered. Scope of collection depends on current /// <seealso cref="Scope"/> state. /// <para>Reference of regular expression language: http://msdn.microsoft.com/en-us/library/az24scfc%28v=vs.110%29.aspx </para> /// </summary> /// <param name="path">Top directory path</param> /// <returns>Files located under specifiad path</returns> public override FileComponent GetFilesFromDirectory(string path) { string[] filePaths = DirectoryWrapper.GetFiles(path, "*", TranslateScope(scope)); string[] filteredFilePaths = filterPathsByRegex(filePaths); return(FileComponentFactory.ConstructComponents(filteredFilePaths)); }
/// <summary> /// Collects all files located under specified path and stores them in <seealso cref="FileComponent"/> object. /// Only results matching specified patern are gathered. Scope of collection depends on current /// <seealso cref="Scope"/> state. /// </summary> /// <param name="path">Top directory path</param> /// <returns>Files located under specifiad path</returns> public override FileComponent GetFilesFromDirectory(string path) { string[] filePaths = DirectoryWrapper.GetFiles(path, this.rule, TranslateScope(this.scope)); return(FileComponentFactory.ConstructComponents(filePaths)); }