Skip to content

Commit 97a9503

Browse files
committed
Address code review comments
- Improved comment for output report to be more descriptive - Added named constant for API extraction calls in tests
1 parent 0f827d2 commit 97a9503

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/DotNetApiDiff/Commands/CompareCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ public override int Execute([NotNull] CommandContext context, [NotNull] CompareC
227227

228228
var report = reportGenerator.GenerateReport(comparisonResult, format);
229229

230-
// Output report
230+
// Output the formatted report to the console using the AnsiConsole library
231231
AnsiConsole.Write(report);
232232

233233
// Determine exit code based on breaking changes

tests/DotNetApiDiff.Tests/Commands/CompareCommandTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ public void Execute_WithValidSettings_ReturnsSuccessExitCode()
261261
Assert.Equal(0, result);
262262
mockAssemblyLoader.Verify(al => al.LoadAssembly(sourceAssemblyPath), Times.Once);
263263
mockAssemblyLoader.Verify(al => al.LoadAssembly(targetAssemblyPath), Times.Once);
264-
mockApiExtractor.Verify(ae => ae.ExtractApiMembers(It.IsAny<System.Reflection.Assembly>()), Times.Exactly(2));
264+
const int EXPECTED_API_EXTRACTION_CALLS = 2; // Number of assemblies processed: source and target
265+
mockApiExtractor.Verify(ae => ae.ExtractApiMembers(It.IsAny<System.Reflection.Assembly>()), Times.Exactly(EXPECTED_API_EXTRACTION_CALLS));
265266
mockApiComparer.Verify(ac => ac.CompareAssemblies(sourceAssembly, targetAssembly), Times.Once);
266267
mockReportGenerator.Verify(rg => rg.GenerateReport(comparisonResult, ReportFormat.Console), Times.Once);
267268
}

0 commit comments

Comments
 (0)