private void GenerateFixtureReports(XPathDocument document, XsltArgumentList args) { Console.WriteLine("Generating fixture reports"); XPathNavigator navi = document.CreateNavigator(); foreach (XPathNavigator node in navi.Select("//Fixture")) { Console.Write('.'); string fileName = string.Format( "{0}_{1}.html", this.EntryAssemblyName.Replace('.', '_'), node.GetAttribute("Name", "").Replace('.', '_') ); fileName = ReportPath.EscapeFileName(fileName); fileName = Path.Combine(this.OutputFolderName, fileName); System.Runtime.CompilerServices.RuntimeHelpers.PrepareConstrainedRegions(); try { using (StreamWriter fixtureWriter = new StreamWriter(fileName)) { UnitResourceManager.HtmlFixtureReport.Transform(node, args, fixtureWriter); } } catch (Exception ex) { Console.WriteLine("Failed generating {0}", fileName); Console.WriteLine(ex.Message); } } Console.WriteLine(); }
public IEnumerable <string> GetPreviousXmlReports() { string searchPattern = String.Format("{0}.html.xml", ReportPath.EscapeAssemblyName(TestAssemblyName)); searchPattern = ReportPath.EscapeFileName(searchPattern); // look for the report file foreach (string xmlreport in Directory.GetFiles( this.ReportOutputPath, searchPattern, SearchOption.AllDirectories )) { yield return(xmlreport); } }
public virtual void SetOutputFileName(string outputFileName) { this.outputFileName = outputFileName.Replace('.', '_'); if (!this.OutputFileName.ToLower().EndsWith('.' + this.DefaultFileExtension)) { this.outputFileName += '.' + this.DefaultFileExtension; } this.outputFileName = ReportPath.EscapeFileName(this.outputFileName); if (!String.IsNullOrEmpty(this.OutputFolderName)) { this.outputFileName = Path.Combine( this.OutputFolderName, this.OutputFileName); } this.outputFileName = Path.GetFullPath(this.OutputFileName); }
public ReportCleaner(string testAssemblyName) { this.pattern = ReportPath.GetRegex(testAssemblyName); }
public void SetOutputFolderName(string path, string testAssemblyName) { string folderName = ReportPath.GetName(testAssemblyName, this.CreationTime); SetOutputFolderName(Path.Combine(path, folderName)); }