using AmiReel.Services; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace AmiReel.Tests.Services; [TestClass] public class RenderNotifierTests { [TestMethod] public void DescribeCompleted_ForVideo_UsesRenderCompleteCopy() { // Act (string title, string body) = RenderNotifier.DescribeCompleted(shorts: false); // Assert Assert.AreEqual("Render complete", title); StringAssert.Contains(body, "successfully"); } [TestMethod] public void DescribeCompleted_ForShorts_UsesShortCompleteCopy() { // Act (string title, string body) = RenderNotifier.DescribeCompleted(shorts: true); // Assert Assert.AreEqual("Short complete", title); StringAssert.Contains(body, "Short"); } [TestMethod] public void DescribeFailed_WithBlankSummary_UsesFallbackBody() { // Act (string title, string body) = RenderNotifier.DescribeFailed(" "); // Assert Assert.AreEqual("Render failed", title); Assert.AreEqual("The render failed.", body); } [TestMethod] public void DescribeFailed_WithLongSummary_TruncatesBody() { // Arrange string summary = new('x', 250); // Act (string title, string body) = RenderNotifier.DescribeFailed(summary); // Assert Assert.AreEqual("Render failed", title); Assert.AreEqual(180, body.Length); StringAssert.EndsWith(body, "..."); } [TestMethod] public void DescribeCancelled_ReturnsCancelledCopy() { // Act (string title, string body) = RenderNotifier.DescribeCancelled(); // Assert Assert.AreEqual("Render cancelled", title); StringAssert.Contains(body, "cancelled"); } }