Files
Terminal.Gui/Tests/UnitTests/Configuration/GlyphTests.cs
Tig fdeaa8331b Fixes #4298 - Updates test namespaces (#4299)
* Refactored test namespaces.
Moved some tests that were in wrong project.
Code cleanup

* Parrallel -> Parallel
2025-10-20 14:14:38 -06:00

56 lines
1.5 KiB
C#

using System.Reflection;
using System.Text;
using System.Text.Json;
using static Terminal.Gui.Configuration.ConfigurationManager;
namespace UnitTests.ConfigurationTests;
public class GlyphTests
{
[Fact]
public void Apply_Applies_Over_Defaults ()
{
try
{
// arrange
Enable (ConfigLocations.HardCoded);
Assert.Equal ((Rune)'⟦', Glyphs.LeftBracket);
var glyph = (Rune)ThemeManager.GetCurrentTheme () ["Glyphs.LeftBracket"].PropertyValue!;
Assert.Equal ((Rune)'⟦', glyph);
ThrowOnJsonErrors = true;
// act
RuntimeConfig = """
{
"Themes": [
{
"Default":
{
"Glyphs.LeftBracket": "["
}
}
]
}
""";
Load (ConfigLocations.Runtime);
Apply ();
// assert
glyph = (Rune)ThemeManager.GetCurrentTheme () ["Glyphs.LeftBracket"].PropertyValue!;
Assert.Equal ((Rune)'[', glyph);
Assert.Equal ((Rune)'[', Glyphs.LeftBracket);
}
finally
{
// clean up
Disable (resetToHardCodedDefaults: true);
}
}
}