Migrate remaining legacy operator workflows

This commit is contained in:
2026-07-12 05:39:27 +09:00
parent ffb8f43c19
commit a01836a2d7
132 changed files with 20566 additions and 720 deletions

View File

@@ -368,6 +368,85 @@ public sealed class PlayoutSafetyValidationTests : IDisposable
ignoreCase: true);
}
[Fact]
public void ResolveCue_OperatorBackgroundUsesOnlyTheSeparateTrustedRoot()
{
using var backgrounds = TemporarySceneDirectory.Create("studio.vrv");
var options = ValidTestOptions();
options.LegacyBackgroundDirectory = backgrounds.Path;
var validated = ValidatedPlayoutOptions.Create(options);
var resolved = validated.ResolveCue(new PlayoutCue(
"test-scene.t2s",
"test-scene",
Mutations:
[
new PlayoutSetBackgroundVideo(
"studio.vrv",
LoopCount: 2004,
LoopInfinite: true,
AssetRoot: PlayoutAssetRoot.OperatorBackgroundDirectory)
]));
var video = Assert.IsType<PlayoutSetBackgroundVideo>(Assert.Single(resolved.Mutations!));
Assert.Equal(
Path.Combine(backgrounds.Path, "studio.vrv"),
video.AssetPath,
ignoreCase: true);
Assert.Equal(PlayoutAssetRoot.OperatorBackgroundDirectory, video.AssetRoot);
}
[Fact]
public void ResolveCue_OperatorBackgroundDoesNotFallBackToCutsRoot()
{
using var backgrounds = TemporarySceneDirectory.Create();
var options = ValidTestOptions();
options.LegacyBackgroundDirectory = backgrounds.Path;
var validated = ValidatedPlayoutOptions.Create(options);
Assert.Throws<PlayoutRequestException>(() => validated.ResolveCue(new PlayoutCue(
"test-scene.t2s",
"test-scene",
Mutations:
[
new PlayoutSetBackgroundVideo(
"Video\\background.vrv",
LoopCount: 2004,
LoopInfinite: true,
AssetRoot: PlayoutAssetRoot.OperatorBackgroundDirectory)
])));
}
[Fact]
public void ResolveCue_RevalidatesConfiguredBackgroundRootAtCommandTime()
{
var lateRoot = Path.Combine(Directory.GetParent(_scenes.Path)!.FullName, "late-background");
var options = ValidTestOptions();
options.LegacyBackgroundDirectory = lateRoot;
var validated = ValidatedPlayoutOptions.Create(options);
Directory.CreateDirectory(lateRoot);
File.WriteAllText(Path.Combine(lateRoot, "studio.vrv"), "late trusted background");
var resolved = validated.ResolveCue(new PlayoutCue(
"test-scene.t2s",
"test-scene",
Mutations:
[
new PlayoutSetBackgroundVideo(
"studio.vrv",
LoopCount: 2004,
LoopInfinite: true,
AssetRoot: PlayoutAssetRoot.OperatorBackgroundDirectory)
]));
var video = Assert.IsType<PlayoutSetBackgroundVideo>(Assert.Single(resolved.Mutations!));
Assert.Equal(
Path.Combine(lateRoot, "studio.vrv"),
video.AssetPath,
ignoreCase: true);
}
[Fact]
public void ResolveCue_AcceptsTheLegacy2004BackgroundVideoLoopValue()
{