using EnvelopeRenderer.Desktop.Core.Launch; namespace EnvelopeRenderer.Desktop.Tests; public class RenderProgressStatusFormatterTests { [Fact] public void Format_Startup_ReturnsFriendlyStartingMessage() { var text = RenderProgressStatusFormatter.Format(new ProgressEvent(ProgressEventKind.Startup, 0, 0, null)); Assert.Contains("Starting", text, StringComparison.OrdinalIgnoreCase); } [Fact] public void Format_Render_IncludesCompletedCountAndElapsedTime() { var text = RenderProgressStatusFormatter.Format(new ProgressEvent(ProgressEventKind.Render, 1804, 392, null)); Assert.Contains("392", text); Assert.Contains("1.8s", text); } [Fact] public void Format_NeverLeaksRawContractFieldNames() { var text = RenderProgressStatusFormatter.Format(new ProgressEvent(ProgressEventKind.Render, 1804, 392, null)); Assert.DoesNotContain("elapsedMs", text); Assert.DoesNotContain("completed=", text); } [Fact] public void Format_Complete_MentionsRecordCount() { var text = RenderProgressStatusFormatter.Format(new ProgressEvent(ProgressEventKind.Complete, 1900, 392, null)); Assert.Contains("392", text); } [Fact] public void Format_Failure_IsNonTechnical() { var text = RenderProgressStatusFormatter.Format( new ProgressEvent(ProgressEventKind.Failure, 1805, 392, "Failed to save PDF to 'out.pdf' (error code 999).")); Assert.Contains("failed", text, StringComparison.OrdinalIgnoreCase); } }