feat(configmanager): add DiffService with tests

This commit is contained in:
Joseph Doherty
2026-01-19 17:44:28 -05:00
parent c8f3c0060d
commit 68da728cdf
3 changed files with 276 additions and 0 deletions
@@ -0,0 +1,38 @@
namespace JdeScoping.ConfigManager.Services;
/// <summary>
/// Represents a line in a diff output.
/// </summary>
public class DiffLine
{
public required int? OldLineNumber { get; init; }
public required int? NewLineNumber { get; init; }
public required string Text { get; init; }
public required DiffLineType Type { get; init; }
}
public enum DiffLineType
{
Unchanged,
Added,
Removed
}
/// <summary>
/// Result of a diff operation.
/// </summary>
public class DiffResult
{
public bool HasChanges { get; init; }
public List<DiffLine> Lines { get; init; } = [];
public int Insertions { get; init; }
public int Deletions { get; init; }
}
/// <summary>
/// Service for generating diffs between text content.
/// </summary>
public interface IDiffService
{
DiffResult GenerateDiff(string original, string modified);
}