Files
LlamaCasty/ytLive.Tests/TransitionFadeTests.cs
T
gramps 90cd039d98 Transitions: fade starts from the outgoing picture (was an instant cut)
The transition started with no from-frame, so BlendFrame returned the new scene at once.
Start now requests a capture and the frame pump supplies its last output on the next tick.
Test: TransitionFadeTests. Docs: ai.md, TASKS.md.

Not pushed.
2026-10-27 08:39:49 -07:00

27 lines
775 B
C#

using ytLive.Services;
using Xunit;
namespace ytLive.Tests;
public class TransitionFadeTests
{
[Fact]
public void Fade_Without_A_From_Frame_Requests_Capture_And_Blends_Once_Supplied()
{
var transition = new TransitionService();
var to = new VideoFrame(2, 2, Enumerable.Repeat((byte)255, 16).ToArray());
var from = new VideoFrame(2, 2, new byte[16]);
transition.Start(TransitionType.Fade, 300, null);
Assert.True(transition.CaptureRequested);
transition.SupplyFromFrame(from);
Assert.False(transition.CaptureRequested);
transition.Tick(150);
var blended = transition.BlendFrame(to);
Assert.NotSame(to, blended);
Assert.NotEqual((byte)255, blended.BgraPixels[0]);
}
}