Files
Terminal.Gui/UnitTests/View/DiagnosticsTests.cs
2024-03-07 09:04:24 -07:00

30 lines
997 B
C#

#nullable enable
using Xunit.Abstractions;
namespace Terminal.Gui.ViewTests;
/// <summary>
/// Tests <see cref="View.Diagnostics"/> static property and <see cref="ViewDiagnosticFlags"/> enum.
/// </summary>
/// <param name="output"></param>
[Trait("Category","Output")]
public class DiagnosticTests (ITestOutputHelper output)
{
/// <summary>
/// /// Tests <see cref="View.Diagnostics"/> static property and <see cref="ViewDiagnosticFlags"/> enum.
/// /// </summary>
[Fact]
public void Diagnostics_Sets ()
{
// View.Diagnostics is a static property that returns the current diagnostic flags.
Assert.Equal (ViewDiagnosticFlags.Off, View.Diagnostics);
// View.Diagnostics can be set to a new value.
View.Diagnostics = ViewDiagnosticFlags.Padding;
Assert.Equal (ViewDiagnosticFlags.Padding, View.Diagnostics);
// Ensure we turn off at the end of the test
View.Diagnostics = ViewDiagnosticFlags.Off;
}
}