Migrate remaining legacy operator workflows
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user