mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Involving assertive code within a region.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// This is a simple example application for a self-contained single file.
|
||||
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
using Terminal.Gui;
|
||||
@@ -13,16 +14,20 @@ public static class Program
|
||||
{
|
||||
Application.Init ();
|
||||
|
||||
#region The code in this region is not intended for use in a self-contained single-file. It's just here to make sure there is no functionality break with localization in Terminal.Gui using single-file
|
||||
|
||||
if (Equals (Thread.CurrentThread.CurrentUICulture, CultureInfo.InvariantCulture))
|
||||
{
|
||||
System.Diagnostics.Debug.Assert (Application.SupportedCultures.Count == 0);
|
||||
Debug.Assert (Application.SupportedCultures.Count == 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Diagnostics.Debug.Assert (Application.SupportedCultures.Count == 4);
|
||||
System.Diagnostics.Debug.Assert (Equals (CultureInfo.CurrentCulture, Thread.CurrentThread.CurrentUICulture));
|
||||
Debug.Assert (Application.SupportedCultures.Count == 4);
|
||||
Debug.Assert (Equals (CultureInfo.CurrentCulture, Thread.CurrentThread.CurrentUICulture));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
ExampleWindow app = new ();
|
||||
Application.Run (app);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user