mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
* Refactored test namespaces. Moved some tests that were in wrong project. Code cleanup * Parrallel -> Parallel
56 lines
1.5 KiB
C#
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);
|
|
|
|
}
|
|
}
|
|
}
|