feat: add safe Tornado K3D playout adapter

This commit is contained in:
2026-07-10 06:41:48 +09:00
parent 39c4504b87
commit 5a8c7028dc
43 changed files with 7341 additions and 92 deletions

View File

@@ -0,0 +1,40 @@
using MBN_STOCK_WEBVIEW.Playout.Safety;
namespace MBN_STOCK_WEBVIEW.Playout.Tests;
public sealed class LiveAuthorizationTests
{
[Theory]
[InlineData(null, false)]
[InlineData("I_AUTHORIZE_LIVE_PROGRAM_OUTPUT_FOR_THIS_LAUNCH ", false)]
[InlineData("i_authorize_live_program_output_for_this_launch", false)]
[InlineData("wrong", false)]
[InlineData(
PlayoutOptionsLoader.RequiredLiveAuthorizationValue,
true)]
public void EnvironmentAuthorization_RequiresExactPerLaunchValue(
string? value,
bool expected)
{
using var environment = new EnvironmentScope()
.Set(PlayoutOptionsLoader.LiveAuthorizationEnvironmentVariable, value);
var authorization = new EnvironmentLiveAuthorization();
Assert.Equal(expected, authorization.IsAuthorizedForThisLaunch);
}
[Fact]
public void EnvironmentAuthorization_IsCapturedOnceAndCannotBeArmedAfterConstruction()
{
using var environment = new EnvironmentScope()
.Set(PlayoutOptionsLoader.LiveAuthorizationEnvironmentVariable, null);
var authorization = new EnvironmentLiveAuthorization();
environment.Set(
PlayoutOptionsLoader.LiveAuthorizationEnvironmentVariable,
PlayoutOptionsLoader.RequiredLiveAuthorizationValue);
Assert.False(authorization.IsAuthorizedForThisLaunch);
}
}