Dim.AutoTests.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  1. using System.Globalization;
  2. using System.Text;
  3. using Xunit.Abstractions;
  4. using static Terminal.Gui.Dim;
  5. // Alias Console to MockConsole so we don't accidentally use Console
  6. using Console = Terminal.Gui.FakeConsole;
  7. namespace Terminal.Gui.PosDimTests;
  8. public class DimAutoTests
  9. {
  10. private readonly ITestOutputHelper _output;
  11. public DimAutoTests (ITestOutputHelper output)
  12. {
  13. _output = output;
  14. Console.OutputEncoding = Encoding.Default;
  15. // Change current culture
  16. var culture = CultureInfo.CreateSpecificCulture ("en-US");
  17. Thread.CurrentThread.CurrentCulture = culture;
  18. Thread.CurrentThread.CurrentUICulture = culture;
  19. }
  20. // Test min - ensure that if min is specified in the DimAuto constructor it is honored
  21. [Fact]
  22. public void DimAuto_Min ()
  23. {
  24. var superView = new View
  25. {
  26. X = 0,
  27. Y = 0,
  28. Width = Dim.Auto (min: 10),
  29. Height = Dim.Auto (min: 10),
  30. ValidatePosDim = true
  31. };
  32. var subView = new View
  33. {
  34. X = 0,
  35. Y = 0,
  36. Width = 5,
  37. Height = 5
  38. };
  39. superView.Add (subView);
  40. superView.BeginInit ();
  41. superView.EndInit ();
  42. superView.SetRelativeLayout (new (10, 10));
  43. superView.LayoutSubviews (); // no throw
  44. Assert.Equal (10, superView.Frame.Width);
  45. Assert.Equal (10, superView.Frame.Height);
  46. }
  47. // what happens if DimAuto (min: 10) and the subview moves to a negative coord?
  48. [Fact]
  49. public void DimAuto_Min_Resets_If_Subview_Moves_Negative ()
  50. {
  51. var superView = new View
  52. {
  53. X = 0,
  54. Y = 0,
  55. Width = Dim.Auto (min: 10),
  56. Height = Dim.Auto (min: 10),
  57. ValidatePosDim = true
  58. };
  59. var subView = new View
  60. {
  61. X = 0,
  62. Y = 0,
  63. Width = 5,
  64. Height = 5
  65. };
  66. superView.Add (subView);
  67. superView.BeginInit ();
  68. superView.EndInit ();
  69. superView.SetRelativeLayout (new ( 10, 10));
  70. superView.LayoutSubviews (); // no throw
  71. Assert.Equal (10, superView.Frame.Width);
  72. Assert.Equal (10, superView.Frame.Height);
  73. subView.X = -1;
  74. subView.Y = -1;
  75. superView.SetRelativeLayout (new ( 10, 10));
  76. superView.LayoutSubviews (); // no throw
  77. Assert.Equal (5, subView.Frame.Width);
  78. Assert.Equal (5, subView.Frame.Height);
  79. Assert.Equal (10, superView.Frame.Width);
  80. Assert.Equal (10, superView.Frame.Height);
  81. }
  82. [Fact]
  83. public void DimAuto_Min_Resets_If_Subview_Shrinks ()
  84. {
  85. var superView = new View
  86. {
  87. X = 0,
  88. Y = 0,
  89. Width = Dim.Auto (min: 10),
  90. Height = Dim.Auto (min: 10),
  91. ValidatePosDim = true
  92. };
  93. var subView = new View
  94. {
  95. X = 0,
  96. Y = 0,
  97. Width = 5,
  98. Height = 5
  99. };
  100. superView.Add (subView);
  101. superView.BeginInit ();
  102. superView.EndInit ();
  103. superView.SetRelativeLayout (new ( 10, 10));
  104. superView.LayoutSubviews (); // no throw
  105. Assert.Equal (10, superView.Frame.Width);
  106. Assert.Equal (10, superView.Frame.Height);
  107. subView.Width = 3;
  108. subView.Height = 3;
  109. superView.SetRelativeLayout (new ( 10, 10));
  110. superView.LayoutSubviews (); // no throw
  111. Assert.Equal (3, subView.Frame.Width);
  112. Assert.Equal (3, subView.Frame.Height);
  113. Assert.Equal (10, superView.Frame.Width);
  114. Assert.Equal (10, superView.Frame.Height);
  115. }
  116. [Theory]
  117. [InlineData (0, 0, 0, 0, 0)]
  118. [InlineData (0, 0, 5, 0, 0)]
  119. [InlineData (0, 0, 0, 5, 5)]
  120. [InlineData (0, 0, 5, 5, 5)]
  121. [InlineData (1, 0, 5, 0, 0)]
  122. [InlineData (1, 0, 0, 5, 5)]
  123. [InlineData (1, 0, 5, 5, 5)]
  124. [InlineData (1, 1, 5, 5, 6)]
  125. [InlineData (-1, 0, 5, 0, 0)]
  126. [InlineData (-1, 0, 0, 5, 5)]
  127. [InlineData (-1, 0, 5, 5, 5)]
  128. [InlineData (-1, -1, 5, 5, 4)]
  129. public void Height_Auto_Width_NotChanged (int subX, int subY, int subWidth, int subHeight, int expectedHeight)
  130. {
  131. var superView = new View
  132. {
  133. X = 0,
  134. Y = 0,
  135. Width = 10,
  136. Height = Dim.Auto (),
  137. ValidatePosDim = true
  138. };
  139. var subView = new View
  140. {
  141. X = subX,
  142. Y = subY,
  143. Width = subWidth,
  144. Height = subHeight,
  145. ValidatePosDim = true
  146. };
  147. superView.Add (subView);
  148. superView.BeginInit ();
  149. superView.EndInit ();
  150. superView.SetRelativeLayout (new ( 10, 10));
  151. Assert.Equal (new Rectangle (0, 0, 10, expectedHeight), superView.Frame);
  152. }
  153. [Fact]
  154. public void NoSubViews_Does_Nothing ()
  155. {
  156. var superView = new View
  157. {
  158. X = 0,
  159. Y = 0,
  160. Width = Dim.Auto (),
  161. Height = Dim.Auto (),
  162. ValidatePosDim = true
  163. };
  164. superView.BeginInit ();
  165. superView.EndInit ();
  166. superView.SetRelativeLayout (new ( 10, 10));
  167. Assert.Equal (new Rectangle (0, 0, 0, 0), superView.Frame);
  168. superView.SetRelativeLayout (new ( 10, 10));
  169. Assert.Equal (new Rectangle (0, 0, 0, 0), superView.Frame);
  170. }
  171. [Fact]
  172. public void NoSubViews_Does_Nothing_Vertical ()
  173. {
  174. var superView = new View
  175. {
  176. X = 0,
  177. Y = 0,
  178. Width = Dim.Auto (),
  179. Height = Dim.Auto (),
  180. TextDirection = TextDirection.TopBottom_LeftRight,
  181. ValidatePosDim = true
  182. };
  183. superView.BeginInit ();
  184. superView.EndInit ();
  185. superView.SetRelativeLayout (new (10, 10));
  186. Assert.Equal (new Rectangle (0, 0, 0, 0), superView.Frame);
  187. superView.SetRelativeLayout (new (10, 10));
  188. Assert.Equal (new Rectangle (0, 0, 0, 0), superView.Frame);
  189. }
  190. [Theory]
  191. [InlineData (0, 0, 0, 0, 0, 0)]
  192. [InlineData (0, 0, 5, 0, 5, 0)]
  193. [InlineData (0, 0, 0, 5, 0, 5)]
  194. [InlineData (0, 0, 5, 5, 5, 5)]
  195. [InlineData (1, 0, 5, 0, 6, 0)]
  196. [InlineData (1, 0, 0, 5, 1, 5)]
  197. [InlineData (1, 0, 5, 5, 6, 5)]
  198. [InlineData (1, 1, 5, 5, 6, 6)]
  199. [InlineData (-1, 0, 5, 0, 4, 0)]
  200. [InlineData (-1, 0, 0, 5, 0, 5)]
  201. [InlineData (-1, 0, 5, 5, 4, 5)]
  202. [InlineData (-1, -1, 5, 5, 4, 4)]
  203. public void SubView_ChangesSuperViewSize (int subX, int subY, int subWidth, int subHeight, int expectedWidth, int expectedHeight)
  204. {
  205. var superView = new View
  206. {
  207. X = 0,
  208. Y = 0,
  209. Width = Dim.Auto (),
  210. Height = Dim.Auto (),
  211. ValidatePosDim = true
  212. };
  213. var subView = new View
  214. {
  215. X = subX,
  216. Y = subY,
  217. Width = subWidth,
  218. Height = subHeight,
  219. ValidatePosDim = true
  220. };
  221. superView.Add (subView);
  222. superView.BeginInit ();
  223. superView.EndInit ();
  224. superView.SetRelativeLayout (new ( 10, 10));
  225. Assert.Equal (new Rectangle (0, 0, expectedWidth, expectedHeight), superView.Frame);
  226. }
  227. // Test validation
  228. [Fact]
  229. public void ValidatePosDim_True_Throws_When_SubView_Uses_SuperView_Dims ()
  230. {
  231. var superView = new View
  232. {
  233. X = 0,
  234. Y = 0,
  235. Width = Dim.Auto (),
  236. Height = Dim.Auto (),
  237. ValidatePosDim = true
  238. };
  239. var subView = new View
  240. {
  241. X = 0,
  242. Y = 0,
  243. Width = Dim.Fill (),
  244. Height = 10,
  245. ValidatePosDim = true
  246. };
  247. superView.BeginInit ();
  248. superView.EndInit ();
  249. Assert.Throws<InvalidOperationException> (() => superView.Add (subView));
  250. subView.Width = 10;
  251. superView.Add (subView);
  252. superView.SetRelativeLayout (new ( 10, 10));
  253. superView.LayoutSubviews (); // no throw
  254. subView.Width = Dim.Fill ();
  255. Assert.Throws<InvalidOperationException> (() => superView.SetRelativeLayout (new ( 0, 0)));
  256. subView.Width = 10;
  257. subView.Height = Dim.Fill ();
  258. Assert.Throws<InvalidOperationException> (() => superView.SetRelativeLayout (new ( 0, 0)));
  259. subView.Height = 10;
  260. subView.Height = Dim.Percent (50);
  261. Assert.Throws<InvalidOperationException> (() => superView.SetRelativeLayout (new ( 0, 0)));
  262. subView.Height = 10;
  263. subView.X = Pos.Center ();
  264. Assert.Throws<InvalidOperationException> (() => superView.SetRelativeLayout (new ( 0, 0)));
  265. subView.X = 0;
  266. subView.Y = Pos.Center ();
  267. Assert.Throws<InvalidOperationException> (() => superView.SetRelativeLayout (new ( 0, 0)));
  268. subView.Y = 0;
  269. subView.Width = 10;
  270. subView.Height = 10;
  271. subView.X = 0;
  272. subView.Y = 0;
  273. superView.SetRelativeLayout (new ( 0, 0));
  274. superView.LayoutSubviews ();
  275. }
  276. // Test validation
  277. [Fact]
  278. public void ValidatePosDim_True_Throws_When_SubView_Uses_SuperView_Dims_Combine ()
  279. {
  280. var superView = new View
  281. {
  282. X = 0,
  283. Y = 0,
  284. Width = Dim.Auto (),
  285. Height = Dim.Auto (),
  286. ValidatePosDim = true
  287. };
  288. var subView = new View
  289. {
  290. X = 0,
  291. Y = 0,
  292. Width = 10,
  293. Height = 10
  294. };
  295. var subView2 = new View
  296. {
  297. X = 0,
  298. Y = 0,
  299. Width = 10,
  300. Height = 10
  301. };
  302. superView.Add (subView, subView2);
  303. superView.BeginInit ();
  304. superView.EndInit ();
  305. superView.SetRelativeLayout (new ( 0, 0));
  306. superView.LayoutSubviews (); // no throw
  307. subView.Height = Dim.Fill () + 3;
  308. Assert.Throws<InvalidOperationException> (() => superView.SetRelativeLayout (new ( 0, 0)));
  309. subView.Height = 0;
  310. subView.Height = 3 + Dim.Fill ();
  311. Assert.Throws<InvalidOperationException> (() => superView.SetRelativeLayout (new ( 0, 0)));
  312. subView.Height = 0;
  313. subView.Height = 3 + 5 + Dim.Fill ();
  314. Assert.Throws<InvalidOperationException> (() => superView.SetRelativeLayout (new ( 0, 0)));
  315. subView.Height = 0;
  316. subView.Height = 3 + 5 + Dim.Percent (10);
  317. Assert.Throws<InvalidOperationException> (() => superView.SetRelativeLayout (new ( 0, 0)));
  318. subView.Height = 0;
  319. // Tests nested Combine
  320. subView.Height = 5 + new Dim.DimCombine (true, 3, new Dim.DimCombine (true, Dim.Percent (10), 9));
  321. Assert.Throws<InvalidOperationException> (() => superView.SetRelativeLayout (new ( 0, 0)));
  322. }
  323. [Fact]
  324. public void ValidatePosDim_True_Throws_When_SubView_Uses_SuperView_Pos_Combine ()
  325. {
  326. var superView = new View
  327. {
  328. X = 0,
  329. Y = 0,
  330. Width = Dim.Auto (),
  331. Height = Dim.Auto (),
  332. ValidatePosDim = true
  333. };
  334. var subView = new View
  335. {
  336. X = 0,
  337. Y = 0,
  338. Width = 10,
  339. Height = 10
  340. };
  341. var subView2 = new View
  342. {
  343. X = 0,
  344. Y = 0,
  345. Width = 10,
  346. Height = 10
  347. };
  348. superView.Add (subView, subView2);
  349. superView.BeginInit ();
  350. superView.EndInit ();
  351. superView.SetRelativeLayout (new ( 0, 0));
  352. superView.LayoutSubviews (); // no throw
  353. subView.X = Pos.Right (subView2);
  354. superView.SetRelativeLayout (new ( 0, 0));
  355. superView.LayoutSubviews (); // no throw
  356. subView.X = Pos.Right (subView2) + 3;
  357. superView.SetRelativeLayout (new ( 0, 0)); // no throw
  358. superView.LayoutSubviews (); // no throw
  359. subView.X = new Pos.PosCombine (true, Pos.Right (subView2), new Pos.PosCombine (true, 7, 9));
  360. superView.SetRelativeLayout (new ( 0, 0)); // no throw
  361. subView.X = Pos.Center () + 3;
  362. Assert.Throws<InvalidOperationException> (() => superView.SetRelativeLayout (new ( 0, 0)));
  363. subView.X = 0;
  364. subView.X = 3 + Pos.Center ();
  365. Assert.Throws<InvalidOperationException> (() => superView.SetRelativeLayout (new ( 0, 0)));
  366. subView.X = 0;
  367. subView.X = 3 + 5 + Pos.Center ();
  368. Assert.Throws<InvalidOperationException> (() => superView.SetRelativeLayout (new ( 0, 0)));
  369. subView.X = 0;
  370. subView.X = 3 + 5 + Pos.Percent (10);
  371. Assert.Throws<InvalidOperationException> (() => superView.SetRelativeLayout (new ( 0, 0)));
  372. subView.X = 0;
  373. subView.X = Pos.Percent (10) + Pos.Center ();
  374. Assert.Throws<InvalidOperationException> (() => superView.SetRelativeLayout (new ( 0, 0)));
  375. subView.X = 0;
  376. // Tests nested Combine
  377. subView.X = 5 + new Pos.PosCombine (true, Pos.Right (subView2), new Pos.PosCombine (true, Pos.Center (), 9));
  378. Assert.Throws<InvalidOperationException> (() => superView.SetRelativeLayout (new ( 0, 0)));
  379. subView.X = 0;
  380. }
  381. [Theory]
  382. [InlineData (0, 0, 0, 0, 0)]
  383. [InlineData (0, 0, 5, 0, 5)]
  384. [InlineData (0, 0, 0, 5, 0)]
  385. [InlineData (0, 0, 5, 5, 5)]
  386. [InlineData (1, 0, 5, 0, 6)]
  387. [InlineData (1, 0, 0, 5, 1)]
  388. [InlineData (1, 0, 5, 5, 6)]
  389. [InlineData (1, 1, 5, 5, 6)]
  390. [InlineData (-1, 0, 5, 0, 4)]
  391. [InlineData (-1, 0, 0, 5, 0)]
  392. [InlineData (-1, 0, 5, 5, 4)]
  393. [InlineData (-1, -1, 5, 5, 4)]
  394. public void Width_Auto_Height_NotChanged (int subX, int subY, int subWidth, int subHeight, int expectedWidth)
  395. {
  396. var superView = new View
  397. {
  398. X = 0,
  399. Y = 0,
  400. Width = Dim.Auto (),
  401. Height = 10,
  402. ValidatePosDim = true
  403. };
  404. var subView = new View
  405. {
  406. X = subX,
  407. Y = subY,
  408. Width = subWidth,
  409. Height = subHeight,
  410. ValidatePosDim = true
  411. };
  412. superView.Add (subView);
  413. superView.BeginInit ();
  414. superView.EndInit ();
  415. superView.SetRelativeLayout (new ( 10, 10));
  416. Assert.Equal (new Rectangle (0, 0, expectedWidth, 10), superView.Frame);
  417. }
  418. // Test that when a view has Width set to DimAuto (min: x) the width is never < x even if SetRelativeLayout is called with smaller bounds
  419. [Theory]
  420. [InlineData (0, 0)]
  421. [InlineData (1, 1)]
  422. [InlineData (3, 3)]
  423. [InlineData (4, 4)]
  424. [InlineData (5, 4)] // This is clearly invalid, but we choose to not throw but log a debug message
  425. public void Width_Auto_Min (int min, int expectedWidth)
  426. {
  427. var superView = new View
  428. {
  429. X = 0,
  430. Y = 0,
  431. Width = Dim.Auto (min: min),
  432. Height = 1,
  433. ValidatePosDim = true
  434. };
  435. superView.BeginInit ();
  436. superView.EndInit ();
  437. superView.SetRelativeLayout (new ( 4, 1));
  438. Assert.Equal (expectedWidth, superView.Frame.Width);
  439. }
  440. // Test Dim.Fill - Fill should not impact width of the DimAuto superview
  441. [Theory]
  442. [InlineData (0, 0, 0, 10, 10)]
  443. [InlineData (0, 1, 0, 10, 10)]
  444. [InlineData (0, 11, 0, 10, 10)]
  445. [InlineData (0, 10, 0, 10, 10)]
  446. [InlineData (0, 5, 0, 10, 10)]
  447. [InlineData (1, 5, 0, 10, 9)]
  448. [InlineData (1, 10, 0, 10, 9)]
  449. [InlineData (0, 0, 1, 10, 9)]
  450. [InlineData (0, 10, 1, 10, 9)]
  451. [InlineData (0, 5, 1, 10, 9)]
  452. [InlineData (1, 5, 1, 10, 8)]
  453. [InlineData (1, 10, 1, 10, 8)]
  454. public void Width_Fill_Fills (int subX, int superMinWidth, int fill, int expectedSuperWidth, int expectedSubWidth)
  455. {
  456. var superView = new View
  457. {
  458. X = 0,
  459. Y = 0,
  460. Width = Dim.Auto (min:superMinWidth),
  461. Height = 1,
  462. ValidatePosDim = true
  463. };
  464. var subView = new View
  465. {
  466. X = subX,
  467. Y = 0,
  468. Width = Dim.Fill (fill),
  469. Height = 1,
  470. ValidatePosDim = true
  471. };
  472. superView.Add (subView);
  473. superView.BeginInit ();
  474. superView.EndInit ();
  475. superView.SetRelativeLayout (new ( 10, 1));
  476. Assert.Equal (expectedSuperWidth, superView.Frame.Width);
  477. superView.LayoutSubviews ();
  478. Assert.Equal (expectedSubWidth, subView.Frame.Width);
  479. Assert.Equal (expectedSuperWidth, superView.Frame.Width);
  480. }
  481. [Theory]
  482. [InlineData (0, 1, 1)]
  483. [InlineData (1, 1, 1)]
  484. [InlineData (9, 1, 1)]
  485. [InlineData (10, 1, 1)]
  486. [InlineData (0, 10, 10)]
  487. [InlineData (1, 10, 10)]
  488. [InlineData (9, 10, 10)]
  489. [InlineData (10, 10, 10)]
  490. public void Width_Auto_Text_Does_Not_Constrain_To_SuperView (int subX, int textLen, int expectedSubWidth)
  491. {
  492. var superView = new View
  493. {
  494. X = 0,
  495. Y = 0,
  496. Width = 10,
  497. Height = 1,
  498. ValidatePosDim = true
  499. };
  500. var subView = new View
  501. {
  502. Text = new string ('*', textLen),
  503. X = subX,
  504. Y = 0,
  505. Width = Dim.Auto (Dim.DimAutoStyle.Text),
  506. Height = 1,
  507. ValidatePosDim = true
  508. };
  509. superView.Add (subView);
  510. superView.BeginInit ();
  511. superView.EndInit ();
  512. superView.SetRelativeLayout (superView.ContentSize);
  513. superView.LayoutSubviews ();
  514. Assert.Equal (expectedSubWidth, subView.Frame.Width);
  515. }
  516. [Theory]
  517. [InlineData (0, 1, 1)]
  518. [InlineData (1, 1, 1)]
  519. [InlineData (9, 1, 1)]
  520. [InlineData (10, 1, 1)]
  521. [InlineData (0, 10, 10)]
  522. [InlineData (1, 10, 10)]
  523. [InlineData (9, 10, 10)]
  524. [InlineData (10, 10, 10)]
  525. public void Width_Auto_Subviews_Does_Not_Constrain_To_SuperView (int subX, int subSubViewWidth, int expectedSubWidth)
  526. {
  527. var superView = new View
  528. {
  529. X = 0,
  530. Y = 0,
  531. Width = 10,
  532. Height = 1,
  533. ValidatePosDim = true
  534. };
  535. var subView = new View
  536. {
  537. X = subX,
  538. Y = 0,
  539. Width = Dim.Auto (Dim.DimAutoStyle.Subviews),
  540. Height = 1,
  541. ValidatePosDim = true
  542. };
  543. var subSubView = new View
  544. {
  545. X = 0,
  546. Y = 0,
  547. Width = subSubViewWidth,
  548. Height = 1,
  549. ValidatePosDim = true
  550. };
  551. subView.Add (subSubView);
  552. superView.Add (subView);
  553. superView.BeginInit ();
  554. superView.EndInit ();
  555. superView.SetRelativeLayout (superView.ContentSize);
  556. superView.LayoutSubviews ();
  557. Assert.Equal (expectedSubWidth, subView.Frame.Width);
  558. }
  559. [Fact]
  560. public void DimAuto_Text_Viewport_Stays_Set ()
  561. {
  562. var super = new View ()
  563. {
  564. Width = Dim.Fill (),
  565. Height = Dim.Fill ()
  566. };
  567. var view = new View ()
  568. {
  569. Text = "01234567",
  570. Width = Auto (DimAutoStyle.Text),
  571. Height = Auto (DimAutoStyle.Text),
  572. };
  573. super.Add (view);
  574. Rectangle expectedViewport = new (0, 0, 8, 1);
  575. Assert.Equal (expectedViewport.Size, view.ContentSize);
  576. Assert.Equal (expectedViewport, view.Frame);
  577. Assert.Equal (expectedViewport, view.Viewport);
  578. super.LayoutSubviews ();
  579. Assert.Equal (expectedViewport, view.Viewport);
  580. super.Dispose ();
  581. }
  582. // Test variations of Frame
  583. }