소스 검색

Also testing with a Pos and Dim null values.

BDisp 5 년 전
부모
커밋
8c5822f9e2
2개의 변경된 파일8개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 1
      UnitTests/DimTests.cs
  2. 4 1
      UnitTests/PosTests.cs

+ 4 - 1
UnitTests/DimTests.cs

@@ -248,7 +248,9 @@ namespace Terminal.Gui {
 				Width = Dim.Width (w) - 2,
 				Height = Dim.Percent (10)
 			};
-			w.Add (v);
+			var vn = new View (new Rect (1, 2, 3, 3));
+
+			w.Add (v, vn);
 			t.Add (w);
 
 			t.Ready += () => {
@@ -258,6 +260,7 @@ namespace Terminal.Gui {
 				Assert.Equal (2, w.Height);
 				Assert.Throws<ArgumentException> (() => v.Width = 2);
 				Assert.Throws<ArgumentException> (() => v.Height = 2);
+				Assert.Equal (4, vn.Height = 4);
 			};
 
 			Application.Iteration += () => Application.RequestStop ();

+ 4 - 1
UnitTests/PosTests.cs

@@ -387,7 +387,9 @@ namespace Terminal.Gui {
 				X = Pos.Center (),
 				Y = Pos.Percent (10)
 			};
-			w.Add (v);
+			var vn = new View (new Rect (1, 3, 3, 4));
+
+			w.Add (v, vn);
 			t.Add (w);
 
 			t.Ready += () => {
@@ -397,6 +399,7 @@ namespace Terminal.Gui {
 				Assert.Equal (2, w.Y);
 				Assert.Throws<ArgumentException> (() => v.X = 2);
 				Assert.Throws<ArgumentException> (() => v.Y = 2);
+				Assert.Equal (2, vn.Y = 2);
 			};
 
 			Application.Iteration += () => Application.RequestStop ();