Files
Terminal.Gui/UnitTests/FileServices/NerdFontsTests.cs
Thomas Nind c04703f5d6 Fixes #2617 - Support for Nerd icons for FileDialog (#2613)
* Add explicit file name unicode mappings

* Added nerd file extensions

* Add folder icon

* Added tests and attribution

* Fix tree view not using System.IO.Abstractions

* Make FileDialog tree use IconGetter

* Added context to IconGetter

* Make Nerd a config setting

* Fix typo in attribution

* tidy up

* Change open folder check to null or whitespace

* Update class diagram to show new classes

* Rename configuration property NerdFonts and set it to ThemeScope

* Move NerdFonts setting to ConsoleDriver

* Move NerdFonts setting to NerdFonts class and rename Enable

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
2023-05-13 08:14:19 +02:00

37 lines
828 B
C#

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.IO.Abstractions.TestingHelpers;
using System.Linq;
using Terminal.Gui;
using Xunit;
using Xunit.Abstractions;
namespace Terminal.Gui.FileServicesTests {
public class NerdFontTests
{
[Fact]
public void TestAllFilenamesMapToKnownGlyphs()
{
var f = new NerdFonts();
foreach(var k in f.FilenameToIcon)
{
Assert.Contains(k.Value, f.Glyphs.Keys);
}
}
[Fact]
public void TestAllExtensionsMapToKnownGlyphs()
{
var f = new NerdFonts();
foreach(var k in f.ExtensionToIcon)
{
Assert.Contains(k.Value, f.Glyphs.Keys);
}
}
}
}