public void WriteRoslynReportPaths_WritesEncodedPaths(string language, string expectedPropertyKey) { var config = new AnalysisConfig(); var propertiesWriter = new PropertiesWriter(config, new TestLogger()); var someGuid = new Guid("5762C17D-1DDF-4C77-86AC-E2B4940926A9"); var projectInfo = new ProjectInfo() { ProjectGuid = someGuid, ProjectLanguage = language }; var projectData = new ProjectData(projectInfo); projectData.RoslynReportFilePaths.Add(new FileInfo(@"c:\dir1\first")); projectData.RoslynReportFilePaths.Add(new FileInfo(@"c:\dir1\second")); propertiesWriter.WriteRoslynReportPaths(projectData); propertiesWriter.Flush().Should().Be( $@"5762C17D-1DDF-4C77-86AC-E2B4940926A9.{expectedPropertyKey}=\ c:\\dir1\\first,\ c:\\dir1\\second sonar.modules= "); }
public void WriteRoslynReportPaths_ForUnexpectedLanguage_DoNotWritesOutPaths() { var config = new AnalysisConfig(); var propertiesWriter = new PropertiesWriter(config, new TestLogger()); var someGuid = new Guid("5762C17D-1DDF-4C77-86AC-E2B4940926A9"); var projectInfo = new ProjectInfo() { ProjectGuid = someGuid, ProjectLanguage = "unexpected" }; var projectData = new ProjectData(projectInfo); projectData.RoslynReportFilePaths.Add(new FileInfo(@"c:\dir1\dir2")); propertiesWriter.WriteRoslynReportPaths(projectData); propertiesWriter.Flush().Should().Be( @"sonar.modules= "); }