diff --git a/tests/Titano.App.Tests/Editor/EditorSmokeTests.cs b/tests/Titano.App.Tests/Editor/EditorSmokeTests.cs index 613014b6..137b5ef2 100644 --- a/tests/Titano.App.Tests/Editor/EditorSmokeTests.cs +++ b/tests/Titano.App.Tests/Editor/EditorSmokeTests.cs @@ -1,3 +1,4 @@ +using System.Globalization; using System.Windows; using System.Windows.Controls; using System.Windows.Media; @@ -9,6 +10,7 @@ using Titano.App.Infrastructure; using Titano.App.Sections; using Titano.App.Shell; using Titano.App.Tests.Windows; +using Titano.Core.Advice; using Titano.Core.Export; using Titano.Core.Localization; using Titano.Core.Model; @@ -32,6 +34,26 @@ public sealed class EditorSmokeTests { private static readonly AppTheme[] Themes = [AppTheme.Dark, AppTheme.Light]; + /// Here rather than with the other texts: it switches the UI language, which only a serial class may do. + [Test] + public void AnOptimiseLinePointsFromTheOldValueToTheNewOneInEitherReadingDirection() + { + var change = new SettingChange(AdvisorParameters.DeflickerWindow, 21, 41, "reason", []); + try + { + Loc.SetCulture(CultureInfo.GetCultureInfo("en")); + Assert.Equal("Deflicker window: 21 frames → 41 frames", EditorText.Change(change)); + Loc.SetCulture(CultureInfo.GetCultureInfo("ar")); + Assert.Equal(Loc.L("Editor.Optimise.ChangeRtl", Loc.L("Editor.Exposure.Window"), Loc.Plural("Editor.Value.Frames", 21), Loc.Plural("Editor.Value.Frames", 41)), + EditorText.Change(change), "Arabic reads the old value first, from the right"); + Assert.Contains("←", EditorText.Change(change)); + } + finally + { + Loc.SetCulture(CultureInfo.GetCultureInfo("en")); + } + } + [Test] public Task EverySectionOfTheEditorRendersInBothThemes() => ScreenHost.RunAsync(async () => { diff --git a/tests/Titano.App.Tests/Editor/EditorTextTests.cs b/tests/Titano.App.Tests/Editor/EditorTextTests.cs index 166be194..cf5df466 100644 --- a/tests/Titano.App.Tests/Editor/EditorTextTests.cs +++ b/tests/Titano.App.Tests/Editor/EditorTextTests.cs @@ -1,4 +1,3 @@ -using System.Globalization; using Titano.App.Editor; using Titano.Core.Advice; using Titano.Core.Imaging; @@ -37,24 +36,6 @@ public sealed class EditorTextTests Assert.Equal("3 frames", EditorText.Value(AdvisorParameters.Excluded, new[] { 1, 2, 3 })); } - [Test] - public void AnOptimiseLinePointsFromTheOldValueToTheNewOneInEitherReadingDirection() - { - var change = new SettingChange(AdvisorParameters.DeflickerWindow, 21, 41, "reason", []); - Assert.Equal("Deflicker window: 21 frames → 41 frames", EditorText.Change(change)); - try - { - Loc.SetCulture(CultureInfo.GetCultureInfo("ar")); - Assert.Equal(Loc.L("Editor.Optimise.ChangeRtl", Loc.L("Editor.Exposure.Window"), Loc.Plural("Editor.Value.Frames", 21), Loc.Plural("Editor.Value.Frames", 41)), - EditorText.Change(change), "Arabic reads the old value first, from the right"); - Assert.Contains("←", EditorText.Change(change)); - } - finally - { - Loc.SetCulture(CultureInfo.GetCultureInfo("en")); - } - } - [Test] public void CropMarginsKeepAtLeastATenthOfTheFrame() {