* replace FluentAssertions with Shouldly * fix song transcoding tests * only specify hwaccel when hardware decode is required * update changelog
50 lines
1.4 KiB
C#
50 lines
1.4 KiB
C#
using System.Collections.Generic;
|
|
using ErsatzTV.FFmpeg.Filter;
|
|
using ErsatzTV.FFmpeg.State;
|
|
using Shouldly;
|
|
using LanguageExt;
|
|
using NUnit.Framework;
|
|
|
|
namespace ErsatzTV.FFmpeg.Tests.Filter;
|
|
|
|
[TestFixture]
|
|
public class WatermarkOpacityFilterTests
|
|
{
|
|
[Test]
|
|
// this needs to be a culture where ',' is a decimal separator
|
|
[SetCulture("it-IT")]
|
|
public void Should_Return_Filter_With_Period_Decimal_Unlike_Local_Culture()
|
|
{
|
|
var filter = new WatermarkOpacityFilter(
|
|
new WatermarkState(
|
|
Option<List<WatermarkFadePoint>>.None,
|
|
WatermarkLocation.BottomRight,
|
|
WatermarkSize.ActualSize,
|
|
50,
|
|
50,
|
|
50,
|
|
75,
|
|
false));
|
|
|
|
filter.Filter.ShouldBe("format=yuva420p|yuva444p|yuva422p|rgba|abgr|bgra|gbrap|ya8,colorchannelmixer=aa=0.75");
|
|
}
|
|
|
|
[Test]
|
|
[SetCulture("en-US")]
|
|
public void Should_Return_Filter_With_Period_Decimal()
|
|
{
|
|
var filter = new WatermarkOpacityFilter(
|
|
new WatermarkState(
|
|
Option<List<WatermarkFadePoint>>.None,
|
|
WatermarkLocation.BottomRight,
|
|
WatermarkSize.ActualSize,
|
|
50,
|
|
50,
|
|
50,
|
|
75,
|
|
false));
|
|
|
|
filter.Filter.ShouldBe("format=yuva420p|yuva444p|yuva422p|rgba|abgr|bgra|gbrap|ya8,colorchannelmixer=aa=0.75");
|
|
}
|
|
}
|