Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tznind committed Feb 27, 2025
1 parent e8247da commit e0b7ae9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/ViewExtensionsTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using Terminal.Gui;
using TerminalGuiDesigner;
using static System.Runtime.InteropServices.JavaScript.JSType;

namespace UnitTests;

Expand Down Expand Up @@ -32,6 +33,9 @@ public void TestHitTest(int x, int y, bool hit, bool border, bool lowerRight)
v.Width = 5;
v.Height = 3;

// Hit test does not find things that are not designable
v.Data = new Design(new SourceCodeFile("MyView.cs"), "myview", v);

Application.Top.Add(v);
bool isLowerRight;
bool isBorder;
Expand All @@ -49,7 +53,7 @@ public void TestHitTest(int x, int y, bool hit, bool border, bool lowerRight)
}
else
{
ClassicAssert.IsNull(result);
ClassicAssert.AreSame(Application.Top,result);
}

ClassicAssert.AreEqual(lowerRight, isLowerRight);
Expand Down Expand Up @@ -92,6 +96,9 @@ public void TestHitTest_WindowWithFrameView_InBorder()
Height = 5,
};

// Hit test does not find things that are not designable
f.Data = new Design(new SourceCodeFile("MyView.cs"), "myframe", f);

w.Add(f);
Application.Begin(w);
w.LayoutSubviews();
Expand Down

0 comments on commit e0b7ae9

Please sign in to comment.