Skip to content

Commit e0b7ae9

Browse files
committed
Fix unit tests
1 parent e8247da commit e0b7ae9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/ViewExtensionsTests.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using Terminal.Gui;
33
using TerminalGuiDesigner;
4+
using static System.Runtime.InteropServices.JavaScript.JSType;
45

56
namespace UnitTests;
67

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

36+
// Hit test does not find things that are not designable
37+
v.Data = new Design(new SourceCodeFile("MyView.cs"), "myview", v);
38+
3539
Application.Top.Add(v);
3640
bool isLowerRight;
3741
bool isBorder;
@@ -49,7 +53,7 @@ public void TestHitTest(int x, int y, bool hit, bool border, bool lowerRight)
4953
}
5054
else
5155
{
52-
ClassicAssert.IsNull(result);
56+
ClassicAssert.AreSame(Application.Top,result);
5357
}
5458

5559
ClassicAssert.AreEqual(lowerRight, isLowerRight);
@@ -92,6 +96,9 @@ public void TestHitTest_WindowWithFrameView_InBorder()
9296
Height = 5,
9397
};
9498

99+
// Hit test does not find things that are not designable
100+
f.Data = new Design(new SourceCodeFile("MyView.cs"), "myframe", f);
101+
95102
w.Add(f);
96103
Application.Begin(w);
97104
w.LayoutSubviews();

0 commit comments

Comments
 (0)