Migrate remaining legacy operator workflows
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using MBN_STOCK_WEBVIEW.Core.Playout;
|
||||
using MBN_STOCK_WEBVIEW.Core.Playout.Scenes;
|
||||
|
||||
namespace MBN_STOCK_WEBVIEW.Playout.Tests;
|
||||
@@ -17,18 +18,24 @@ public sealed class PlayoutSceneCompositionFactoryTests
|
||||
[Fact]
|
||||
public void TrustedRelativeVideo_IsVerifiedEvenInDryRun()
|
||||
{
|
||||
using var scenes = TemporarySceneDirectory.Create("Video\\studio.vrv");
|
||||
using var scenes = TemporarySceneDirectory.Create("5001.t2s");
|
||||
var backgroundRoot = Path.Combine(Directory.GetParent(scenes.Path)!.FullName, "배경");
|
||||
Directory.CreateDirectory(backgroundRoot);
|
||||
File.WriteAllText(Path.Combine(backgroundRoot, "studio.vrv"), "trusted background");
|
||||
var result = PlayoutSceneCompositionFactory.Create(new PlayoutOptions
|
||||
{
|
||||
Mode = PlayoutMode.DryRun,
|
||||
SceneDirectory = scenes.Path,
|
||||
LegacySceneBackgroundKind = LegacySceneBackgroundKind.Video,
|
||||
LegacySceneBackgroundAssetPath = "Video\\studio.vrv"
|
||||
LegacySceneBackgroundAssetPath = "studio.vrv"
|
||||
});
|
||||
|
||||
Assert.Equal(LegacySceneBackgroundKind.Video, result.BackgroundKind);
|
||||
Assert.Equal(Path.Combine("Video", "studio.vrv"), result.BackgroundAssetPath);
|
||||
Assert.Equal("studio.vrv", result.BackgroundAssetPath);
|
||||
Assert.Equal(2004, result.BackgroundVideoLoopCount);
|
||||
Assert.Equal(
|
||||
PlayoutAssetRoot.OperatorBackgroundDirectory,
|
||||
result.BackgroundAssetRoot);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@@ -38,7 +45,13 @@ public sealed class PlayoutSceneCompositionFactoryTests
|
||||
[InlineData("Video\\studio.exe")]
|
||||
public void InvalidOrMissingBackground_FailsBeforeDryRunPrepare(string relativePath)
|
||||
{
|
||||
using var scenes = TemporarySceneDirectory.Create("Video\\studio.vrv");
|
||||
using var scenes = TemporarySceneDirectory.Create("5001.t2s");
|
||||
var backgroundRoot = Path.Combine(Directory.GetParent(scenes.Path)!.FullName, "배경");
|
||||
Directory.CreateDirectory(backgroundRoot);
|
||||
Directory.CreateDirectory(Path.Combine(backgroundRoot, "Video"));
|
||||
File.WriteAllText(
|
||||
Path.Combine(backgroundRoot, "Video", "studio.vrv"),
|
||||
"trusted background");
|
||||
var options = new PlayoutOptions
|
||||
{
|
||||
Mode = PlayoutMode.DryRun,
|
||||
@@ -50,4 +63,33 @@ public sealed class PlayoutSceneCompositionFactoryTests
|
||||
Assert.Throws<PlayoutConfigurationException>(() =>
|
||||
PlayoutSceneCompositionFactory.Create(options));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LegacyDefault_UsesSiblingBackgroundRoot_NotTheCutsRoot()
|
||||
{
|
||||
using var scenes = TemporarySceneDirectory.Create("기본.vrv");
|
||||
var backgroundRoot = Path.Combine(Directory.GetParent(scenes.Path)!.FullName, "배경");
|
||||
Directory.CreateDirectory(backgroundRoot);
|
||||
File.WriteAllText(
|
||||
Path.Combine(backgroundRoot, PlayoutSceneCompositionFactory.LegacyDefaultBackgroundFileName),
|
||||
"trusted background");
|
||||
|
||||
var result = PlayoutSceneCompositionFactory.CreateLegacyDefault(
|
||||
new PlayoutOptions { SceneDirectory = scenes.Path },
|
||||
fadeDuration: 6);
|
||||
|
||||
Assert.Equal("기본.vrv", result.BackgroundAssetPath);
|
||||
Assert.Equal(PlayoutAssetRoot.OperatorBackgroundDirectory, result.BackgroundAssetRoot);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LegacyDefault_MissingSiblingDirectory_FailsClosed()
|
||||
{
|
||||
using var scenes = TemporarySceneDirectory.Create("기본.vrv");
|
||||
|
||||
Assert.Throws<PlayoutConfigurationException>(() =>
|
||||
PlayoutSceneCompositionFactory.CreateLegacyDefault(
|
||||
new PlayoutOptions { SceneDirectory = scenes.Path },
|
||||
fadeDuration: 6));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user