Skip to content

Commit af636d7

Browse files
committed
refactor: update solution file name and output paths in SolutionAnalyzerTests for consistency
1 parent 1f798dc commit af636d7

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

CodeLineCounter.Tests/SolutionAnalyzerTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,25 +214,25 @@ public void export_results_with_valid_input_exports_all_files()
214214
// Arrange
215215
var result = new AnalysisResult
216216
{
217-
SolutionFileName = "TestSolution",
217+
SolutionFileName = "CodelineCounter.sln",
218218
Metrics = new List<NamespaceMetrics>(),
219219
ProjectTotals = new Dictionary<string, int>(),
220220
TotalLines = 1000,
221221
DuplicationMap = new List<DuplicationCode>(),
222222
DependencyList = new List<DependencyRelation>()
223223
};
224224

225-
var basePath = _testDirectory;
226-
var solutionPath = Path.GetFullPath(Path.Combine(basePath, "..", "..", "..", ".."));
225+
var basePath = FileUtils.GetBasePath();
226+
var baseSolutionPath = Path.GetFullPath(Path.Combine(basePath, "..", "..", "..", ".."));
227227

228-
solutionPath = Path.Combine(solutionPath, "TestSolution.sln");
228+
var solutionPath = Path.Combine(baseSolutionPath, "CodelineCounter.sln");
229229
var format = CoreUtils.ExportFormat.CSV;
230230
Console.SetOut(sw);
231-
SolutionAnalyzer.ExportResults(result, solutionPath, format);
231+
SolutionAnalyzer.ExportResults(result, solutionPath, format, baseSolutionPath);
232232
// Assert
233-
Assert.True(File.Exists("TestSolution-CodeMetrics.csv"));
234-
Assert.True(File.Exists("TestSolution-CodeDuplications.csv"));
235-
Assert.True(File.Exists("TestSolution-CodeDependencies.csv"));
233+
Assert.True(File.Exists(Path.Combine(baseSolutionPath, "CodelineCounter-CodeMetrics.csv")));
234+
Assert.True(File.Exists(Path.Combine(baseSolutionPath, "CodelineCounter-CodeDuplications.csv")));
235+
Assert.True(File.Exists(Path.Combine(baseSolutionPath, "CodelineCounter-Dependencies.dot")));
236236
}
237237

238238

CodeLineCounter/Services/SolutionAnalyzer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public static void ExportResults(AnalysisResult result, string solutionPath, Cor
8282
: metricsFileName;
8383

8484
// Export duplications
85-
string duplicationsFileName = $"{baseFileName}-CodeDuplication";
85+
string duplicationsFileName = $"{baseFileName}-CodeDuplications";
8686
duplicationsFileName = CoreUtils.GetExportFileNameWithExtension(duplicationsFileName, format);
8787
string duplicationsOutputPath = outputPath != null
8888
? Path.Combine(outputPath, duplicationsFileName)

0 commit comments

Comments
 (0)