Turn the Shorts tab into a step-by-step wizard and port amigadb-short-fx-v4.sh: Video background style, auto/manual crop, source fade-in, and blur/opacity/margin settings.
93 lines
2.6 KiB
C#
93 lines
2.6 KiB
C#
using AmiReel.Models;
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
namespace AmiReel.Tests.Models;
|
|
|
|
[TestClass]
|
|
public class ShortWizardTests
|
|
{
|
|
[TestMethod]
|
|
public void StepsFor_BrandStyle_IncludesEffectSettingsPage()
|
|
{
|
|
// Act
|
|
IReadOnlyList<ShortWizardStep> steps = ShortWizard.StepsFor(ShortStyle.Brand);
|
|
|
|
// Assert
|
|
CollectionAssert.AreEqual(
|
|
new[]
|
|
{
|
|
ShortWizardStep.Clip,
|
|
ShortWizardStep.Effect,
|
|
ShortWizardStep.StyleOptions,
|
|
ShortWizardStep.Titles,
|
|
ShortWizardStep.Encode,
|
|
},
|
|
steps.ToArray());
|
|
}
|
|
|
|
[TestMethod]
|
|
public void StepsFor_VideoStyle_IncludesEffectSettingsPage()
|
|
{
|
|
// Act
|
|
IReadOnlyList<ShortWizardStep> steps = ShortWizard.StepsFor(ShortStyle.Video);
|
|
|
|
// Assert
|
|
Assert.IsTrue(steps.Contains(ShortWizardStep.StyleOptions));
|
|
Assert.AreEqual(5, steps.Count);
|
|
}
|
|
|
|
[TestMethod]
|
|
public void StepsFor_CropStyle_SkipsEffectSettingsPage()
|
|
{
|
|
// Act
|
|
IReadOnlyList<ShortWizardStep> steps = ShortWizard.StepsFor(ShortStyle.Crop);
|
|
|
|
// Assert
|
|
CollectionAssert.AreEqual(
|
|
new[]
|
|
{
|
|
ShortWizardStep.Clip,
|
|
ShortWizardStep.Effect,
|
|
ShortWizardStep.Titles,
|
|
ShortWizardStep.Encode,
|
|
},
|
|
steps.ToArray());
|
|
}
|
|
|
|
[TestMethod]
|
|
public void NeedsStyleOptions_OnlyBrandAndVideo_ReturnsTrue()
|
|
{
|
|
// Assert
|
|
Assert.IsTrue(ShortWizard.NeedsStyleOptions(ShortStyle.Brand));
|
|
Assert.IsTrue(ShortWizard.NeedsStyleOptions(ShortStyle.Video));
|
|
Assert.IsFalse(ShortWizard.NeedsStyleOptions(ShortStyle.Pixel));
|
|
Assert.IsFalse(ShortWizard.NeedsStyleOptions(ShortStyle.Spectrum));
|
|
}
|
|
|
|
[TestMethod]
|
|
public void Description_ForEveryStyle_IsNonEmpty()
|
|
{
|
|
foreach (ShortStyle style in Enum.GetValues<ShortStyle>())
|
|
{
|
|
// Act
|
|
string description = ShortWizard.Description(style);
|
|
|
|
// Assert
|
|
Assert.IsFalse(string.IsNullOrWhiteSpace(description), $"{style} is missing a description.");
|
|
}
|
|
}
|
|
|
|
[TestMethod]
|
|
public void Title_ForEveryStep_IsNonEmpty()
|
|
{
|
|
foreach (ShortWizardStep step in Enum.GetValues<ShortWizardStep>())
|
|
{
|
|
// Act
|
|
string title = ShortWizard.Title(step);
|
|
|
|
// Assert
|
|
Assert.IsFalse(string.IsNullOrWhiteSpace(title), $"{step} is missing a title.");
|
|
}
|
|
}
|
|
}
|