Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

50 wiersze
1.5KB

  1. using EnvelopeRenderer.Desktop.Core.Launch;
  2. namespace EnvelopeRenderer.Desktop.Tests;
  3. public class RenderProgressStatusFormatterTests
  4. {
  5. [Fact]
  6. public void Format_Startup_ReturnsFriendlyStartingMessage()
  7. {
  8. var text = RenderProgressStatusFormatter.Format(new ProgressEvent(ProgressEventKind.Startup, 0, 0, null));
  9. Assert.Contains("Starting", text, StringComparison.OrdinalIgnoreCase);
  10. }
  11. [Fact]
  12. public void Format_Render_IncludesCompletedCountAndElapsedTime()
  13. {
  14. var text = RenderProgressStatusFormatter.Format(new ProgressEvent(ProgressEventKind.Render, 1804, 392, null));
  15. Assert.Contains("392", text);
  16. Assert.Contains("1.8s", text);
  17. }
  18. [Fact]
  19. public void Format_NeverLeaksRawContractFieldNames()
  20. {
  21. var text = RenderProgressStatusFormatter.Format(new ProgressEvent(ProgressEventKind.Render, 1804, 392, null));
  22. Assert.DoesNotContain("elapsedMs", text);
  23. Assert.DoesNotContain("completed=", text);
  24. }
  25. [Fact]
  26. public void Format_Complete_MentionsRecordCount()
  27. {
  28. var text = RenderProgressStatusFormatter.Format(new ProgressEvent(ProgressEventKind.Complete, 1900, 392, null));
  29. Assert.Contains("392", text);
  30. }
  31. [Fact]
  32. public void Format_Failure_IsNonTechnical()
  33. {
  34. var text = RenderProgressStatusFormatter.Format(
  35. new ProgressEvent(ProgressEventKind.Failure, 1805, 392, "Failed to save PDF to 'out.pdf' (error code 999)."));
  36. Assert.Contains("failed", text, StringComparison.OrdinalIgnoreCase);
  37. }
  38. }

Powered by TurnKey Linux.