Files
Terminal.Gui/Tests/UnitTests/View/Draw/DrawEventTests.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

31 lines
791 B
C#

#nullable enable
using UnitTests;
namespace UnitTests.ViewTests;
[Trait ("Category", "Output")]
public class DrawEventTests
{
[Fact]
[AutoInitShutdown]
public void DrawContentComplete_Event_Is_Always_Called ()
{
var viewCalled = false;
var tvCalled = false;
var view = new View { Width = 10, Height = 10, Text = "View" };
view.DrawComplete += (s, e) => viewCalled = true;
var tv = new TextView { Y = 11, Width = 10, Height = 10 };
tv.DrawComplete += (s, e) => tvCalled = true;
var top = new Toplevel ();
top.Add (view, tv);
Application.Begin (top);
AutoInitShutdownAttribute.RunIteration ();
Assert.True (viewCalled);
Assert.True (tvCalled);
top.Dispose ();
}
}