Browse Source

fixed build warnings

Tigger Kindel 1 year ago
parent
commit
8fffab0274

+ 1 - 1
Terminal.Gui/Views/FileDialog.cs

@@ -729,7 +729,7 @@ namespace Terminal.Gui {
 			this.LayoutSubviews ();
 		}
 		/// <summary>
-		/// Gets a default dialog title, when <see cref="Title"/> is not set or empty, 
+		/// Gets a default dialog title, when <see cref="View.Title"/> is not set or empty, 
 		/// result of the function will be shown.
 		/// </summary>
 		protected virtual string GetDefaultTitle ()

+ 8 - 4
Terminal.Gui/Views/FileSystemColorProvider.cs

@@ -5,11 +5,15 @@ using System.IO.Abstractions;
 
 namespace Terminal.Gui {
 
-
+	/// <summary>
+	/// Provides a way to get the color of a file or directory.
+	/// </summary>
 	public class FileSystemColorProvider {
-		
-
-
+		/// <summary>
+		/// Gets the color to use.
+		/// </summary>
+		/// <param name="file"></param>
+		/// <returns></returns>
 		public TrueColor? GetTrueColor (IFileSystemInfo file)
 		{
 			if (FilenameToColor.ContainsKey (file.Name)) {

+ 4 - 0
Terminal.Gui/Views/SaveDialog.cs

@@ -63,6 +63,10 @@ namespace Terminal.Gui {
 			}
 		}
 
+		/// <summary>
+		/// Gets the default title for the <see cref="SaveDialog"/>.
+		/// </summary>
+		/// <returns></returns>
 		protected override string GetDefaultTitle ()
 		{
 			List<string> titleParts = new () {

+ 1 - 3
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
 

+ 1 - 1
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 ();

+ 3 - 1
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
 	}
 }