From 2710a8e3158d783678deed5be0ace2a90a0ef09b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 16 Oct 2025 13:54:12 +0000 Subject: [PATCH] Port TabTests and merge Dim.FillTests, remove empty ThemeTests Co-authored-by: tig <585482+tig@users.noreply.github.com> --- Tests/UnitTests/Configuration/ThemeTests.cs | 17 -------------- Tests/UnitTests/View/Layout/Dim.FillTests.cs | 23 ------------------- .../View/Layout/Dim.FillTests.cs | 15 ++++++++++++ .../Views/TabTests.cs | 4 ++-- 4 files changed, 17 insertions(+), 42 deletions(-) delete mode 100644 Tests/UnitTests/Configuration/ThemeTests.cs delete mode 100644 Tests/UnitTests/View/Layout/Dim.FillTests.cs rename Tests/{UnitTests => UnitTestsParallelizable}/Views/TabTests.cs (72%) diff --git a/Tests/UnitTests/Configuration/ThemeTests.cs b/Tests/UnitTests/Configuration/ThemeTests.cs deleted file mode 100644 index 5b1769f65..000000000 --- a/Tests/UnitTests/Configuration/ThemeTests.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Text.Json; -using static Terminal.Gui.Configuration.ConfigurationManager; - -namespace Terminal.Gui.ConfigurationTests; - -/// -/// Tests Settings["Theme"] and ThemeManager.Theme -/// -public class ThemeTests -{ - public static readonly JsonSerializerOptions _jsonOptions = new () - { - Converters = { new AttributeJsonConverter (), new ColorJsonConverter () } - }; - - -} diff --git a/Tests/UnitTests/View/Layout/Dim.FillTests.cs b/Tests/UnitTests/View/Layout/Dim.FillTests.cs deleted file mode 100644 index db9d6a964..000000000 --- a/Tests/UnitTests/View/Layout/Dim.FillTests.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Xunit.Abstractions; - -namespace Terminal.Gui.LayoutTests; - -public class DimFillTests (ITestOutputHelper output) -{ - private readonly ITestOutputHelper _output = output; - - [Fact] - public void DimFill_SizedCorrectly () - { - var view = new View { Width = Dim.Fill (), Height = Dim.Fill (), BorderStyle = LineStyle.Single }; - var top = new Toplevel (); - top.Add (view); - - top.Layout (); - - view.SetRelativeLayout (new (32, 5)); - Assert.Equal (32, view.Frame.Width); - Assert.Equal (5, view.Frame.Height); - top.Dispose (); - } -} diff --git a/Tests/UnitTestsParallelizable/View/Layout/Dim.FillTests.cs b/Tests/UnitTestsParallelizable/View/Layout/Dim.FillTests.cs index ea93099f4..fe6cd2ca0 100644 --- a/Tests/UnitTestsParallelizable/View/Layout/Dim.FillTests.cs +++ b/Tests/UnitTestsParallelizable/View/Layout/Dim.FillTests.cs @@ -161,4 +161,19 @@ public class DimFillTests (ITestOutputHelper output) Assert.True (view.IsInitialized); Assert.Equal (expectedViewBounds, view.Viewport); } + + [Fact] + public void DimFill_SizedCorrectly () + { + var view = new View { Width = Dim.Fill (), Height = Dim.Fill (), BorderStyle = LineStyle.Single }; + var top = new Toplevel (); + top.Add (view); + + top.Layout (); + + view.SetRelativeLayout (new (32, 5)); + Assert.Equal (32, view.Frame.Width); + Assert.Equal (5, view.Frame.Height); + top.Dispose (); + } } diff --git a/Tests/UnitTests/Views/TabTests.cs b/Tests/UnitTestsParallelizable/Views/TabTests.cs similarity index 72% rename from Tests/UnitTests/Views/TabTests.cs rename to Tests/UnitTestsParallelizable/Views/TabTests.cs index a4de58bb0..e70d77d0d 100644 --- a/Tests/UnitTests/Views/TabTests.cs +++ b/Tests/UnitTestsParallelizable/Views/TabTests.cs @@ -1,6 +1,6 @@ -namespace Terminal.Gui.ViewsTests; +namespace Terminal.Gui.ViewsTests; -public class TabTests +public class TabTests : UnitTests.Parallelizable.ParallelizableBase { [Fact] public void Constructor_Defaults ()