mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-27 08:17:53 +01:00
* Refactored test namespaces. Moved some tests that were in wrong project. Code cleanup * Parrallel -> Parallel
31 lines
791 B
C#
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 ();
|
|
}
|
|
}
|