Add video preview, source crop, find-videos, and render toasts
Bring the Video tab closer to Shorts with 4K preview stills and crop modes (none, auto, center, plus the visual editor). Settings store a default source folder so Find videos can collect output.avi sequences. Cap the FFmpeg log with auto-scroll, hide repeat spam, and show a Windows notification when a video or short finishes or fails.
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user