Skip to content

Commit

Permalink
fixed build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tig committed Oct 4, 2023
1 parent 6efad45 commit 8fffab0
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Terminal.Gui/Views/FileDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ public override void OnLoaded ()
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 ()
Expand Down
12 changes: 8 additions & 4 deletions Terminal.Gui/Views/FileSystemColorProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@

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)) {
Expand Down
4 changes: 4 additions & 0 deletions Terminal.Gui/Views/SaveDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ public string FileName {
}
}

/// <summary>
/// Gets the default title for the <see cref="SaveDialog"/>.
/// </summary>
/// <returns></returns>
protected override string GetDefaultTitle ()
{
List<string> titleParts = new () {
Expand Down
4 changes: 1 addition & 3 deletions UnitTests/ConsoleDrivers/AddRuneTests.cs
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion UnitTests/Input/ResponderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void Dispose_Works ()

var r = new Responder ();
#if DEBUG_IDISPOSABLE
Assert.Equal (1, Responder.Instances.Count);
Assert.Single (Responder.Instances);
#endif

r.Dispose ();
Expand Down
4 changes: 3 additions & 1 deletion UnitTests/TestHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,17 @@ public override void Before (MethodInfo methodUnderTest)
#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
}

public override void After (MethodInfo methodUnderTest)
{
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
}
}
Expand Down

0 comments on commit 8fffab0

Please sign in to comment.