From 8fffab0274d71187d68a4e504c5b314ce9589d44 Mon Sep 17 00:00:00 2001 From: Tigger Kindel Date: Tue, 3 Oct 2023 10:36:52 -0600 Subject: [PATCH] fixed build warnings --- Terminal.Gui/Views/FileDialog.cs | 2 +- Terminal.Gui/Views/FileSystemColorProvider.cs | 12 ++++++++---- Terminal.Gui/Views/SaveDialog.cs | 4 ++++ UnitTests/ConsoleDrivers/AddRuneTests.cs | 4 +--- UnitTests/Input/ResponderTests.cs | 2 +- UnitTests/TestHelpers.cs | 4 +++- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Terminal.Gui/Views/FileDialog.cs b/Terminal.Gui/Views/FileDialog.cs index db98d5ee2..1cb916e95 100644 --- a/Terminal.Gui/Views/FileDialog.cs +++ b/Terminal.Gui/Views/FileDialog.cs @@ -729,7 +729,7 @@ namespace Terminal.Gui { this.LayoutSubviews (); } /// - /// Gets a default dialog title, when is not set or empty, + /// Gets a default dialog title, when is not set or empty, /// result of the function will be shown. /// protected virtual string GetDefaultTitle () diff --git a/Terminal.Gui/Views/FileSystemColorProvider.cs b/Terminal.Gui/Views/FileSystemColorProvider.cs index 42ae34c9b..7abeadb69 100644 --- a/Terminal.Gui/Views/FileSystemColorProvider.cs +++ b/Terminal.Gui/Views/FileSystemColorProvider.cs @@ -5,11 +5,15 @@ using System.IO.Abstractions; namespace Terminal.Gui { - + /// + /// Provides a way to get the color of a file or directory. + /// public class FileSystemColorProvider { - - - + /// + /// Gets the color to use. + /// + /// + /// public TrueColor? GetTrueColor (IFileSystemInfo file) { if (FilenameToColor.ContainsKey (file.Name)) { diff --git a/Terminal.Gui/Views/SaveDialog.cs b/Terminal.Gui/Views/SaveDialog.cs index e357e704f..ef3ac36b3 100644 --- a/Terminal.Gui/Views/SaveDialog.cs +++ b/Terminal.Gui/Views/SaveDialog.cs @@ -63,6 +63,10 @@ namespace Terminal.Gui { } } + /// + /// Gets the default title for the . + /// + /// protected override string GetDefaultTitle () { List titleParts = new () { diff --git a/UnitTests/ConsoleDrivers/AddRuneTests.cs b/UnitTests/ConsoleDrivers/AddRuneTests.cs index 74246f9a3..5d2e7c5a1 100644 --- a/UnitTests/ConsoleDrivers/AddRuneTests.cs +++ b/UnitTests/ConsoleDrivers/AddRuneTests.cs @@ -1,9 +1,7 @@ -//////using Microsoft.VisualStudio.TestPlatform.Utilities; -using System.Buffers; +using System.Buffers; using System.Text; using Xunit; using Xunit.Abstractions; -using static Terminal.Gui.SpinnerStyle; // Alias Console to MockConsole so we don't accidentally use Console diff --git a/UnitTests/Input/ResponderTests.cs b/UnitTests/Input/ResponderTests.cs index 36b814202..d060db42f 100644 --- a/UnitTests/Input/ResponderTests.cs +++ b/UnitTests/Input/ResponderTests.cs @@ -50,7 +50,7 @@ namespace Terminal.Gui.InputTests { var r = new Responder (); #if DEBUG_IDISPOSABLE - Assert.Equal (1, Responder.Instances.Count); + Assert.Single (Responder.Instances); #endif r.Dispose (); diff --git a/UnitTests/TestHelpers.cs b/UnitTests/TestHelpers.cs index 1e46ae74e..38947e57c 100644 --- a/UnitTests/TestHelpers.cs +++ b/UnitTests/TestHelpers.cs @@ -96,7 +96,7 @@ public class TestRespondersDisposed : Xunit.Sdk.BeforeAfterTestAttribute { #if DEBUG_IDISPOSABLE // Clear out any lingering Responder instances from previous tests Responder.Instances.Clear (); - Assert.Equal (0, Responder.Instances.Count); + Assert.Empty (Responder.Instances); #endif } @@ -104,7 +104,9 @@ public class TestRespondersDisposed : Xunit.Sdk.BeforeAfterTestAttribute { { Debug.WriteLine ($"After: {methodUnderTest.Name}"); #if DEBUG_IDISPOSABLE +#pragma warning disable xUnit2013 // Do not use equality check to check for collection size. Assert.Equal (0, Responder.Instances.Count); +#pragma warning restore xUnit2013 // Do not use equality check to check for collection size. #endif } }