WizardTests.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719
  1. using UnitTests;
  2. using Xunit.Abstractions;
  3. namespace UnitTests.DialogTests;
  4. public class WizardTests ()
  5. {
  6. // =========== Wizard Tests
  7. [Fact]
  8. public void DefaultConstructor_SizedProperly ()
  9. {
  10. var wizard = new Wizard ();
  11. Assert.NotEqual (0, wizard.Width);
  12. Assert.NotEqual (0, wizard.Height);
  13. wizard.Dispose ();
  14. }
  15. [Fact]
  16. [AutoInitShutdown]
  17. public void Finish_Button_Closes ()
  18. {
  19. // https://github.com/gui-cs/Terminal.Gui/issues/1833
  20. Wizard wizard = new ();
  21. WizardStep step1 = new () { Title = "step1" };
  22. wizard.AddStep (step1);
  23. var finishedFired = false;
  24. wizard.Finished += (s, args) => { finishedFired = true; };
  25. var closedFired = false;
  26. wizard.Closed += (s, e) => { closedFired = true; };
  27. RunState runstate = Application.Begin (wizard);
  28. AutoInitShutdownAttribute.RunIteration ();
  29. wizard.NextFinishButton.InvokeCommand (Command.Accept);
  30. AutoInitShutdownAttribute.RunIteration ();
  31. Application.End (runstate);
  32. Assert.True (finishedFired);
  33. Assert.True (closedFired);
  34. step1.Dispose ();
  35. wizard.Dispose ();
  36. // Same test, but with two steps
  37. wizard = new ();
  38. step1 = new() { Title = "step1" };
  39. wizard.AddStep (step1);
  40. WizardStep step2 = new () { Title = "step2" };
  41. wizard.AddStep (step2);
  42. finishedFired = false;
  43. wizard.Finished += (s, args) => { finishedFired = true; };
  44. closedFired = false;
  45. wizard.Closed += (s, e) => { closedFired = true; };
  46. runstate = Application.Begin (wizard);
  47. AutoInitShutdownAttribute.RunIteration ();
  48. Assert.Equal (step1.Title, wizard.CurrentStep.Title);
  49. wizard.NextFinishButton.InvokeCommand (Command.Accept);
  50. Assert.False (finishedFired);
  51. Assert.False (closedFired);
  52. Assert.Equal (step2.Title, wizard.CurrentStep.Title);
  53. Assert.Equal (wizard.GetLastStep ().Title, wizard.CurrentStep.Title);
  54. wizard.NextFinishButton.InvokeCommand (Command.Accept);
  55. Application.End (runstate);
  56. Assert.True (finishedFired);
  57. Assert.True (closedFired);
  58. step1.Dispose ();
  59. step2.Dispose ();
  60. wizard.Dispose ();
  61. // Same test, but with two steps but the 1st one disabled
  62. wizard = new ();
  63. step1 = new() { Title = "step1" };
  64. wizard.AddStep (step1);
  65. step2 = new() { Title = "step2" };
  66. wizard.AddStep (step2);
  67. step1.Enabled = false;
  68. finishedFired = false;
  69. wizard.Finished += (s, args) => { finishedFired = true; };
  70. closedFired = false;
  71. wizard.Closed += (s, e) => { closedFired = true; };
  72. runstate = Application.Begin (wizard);
  73. AutoInitShutdownAttribute.RunIteration ();
  74. Assert.Equal (step2.Title, wizard.CurrentStep.Title);
  75. Assert.Equal (wizard.GetLastStep ().Title, wizard.CurrentStep.Title);
  76. wizard.NextFinishButton.InvokeCommand (Command.Accept);
  77. Application.End (runstate);
  78. Assert.True (finishedFired);
  79. Assert.True (closedFired);
  80. wizard.Dispose ();
  81. }
  82. [Fact]
  83. public void Navigate_GetFirstStep_Works ()
  84. {
  85. var wizard = new Wizard ();
  86. Assert.Null (wizard.GetFirstStep ());
  87. var step1 = new WizardStep { Title = "step1" };
  88. wizard.AddStep (step1);
  89. Assert.Equal (step1.Title, wizard.GetFirstStep ().Title);
  90. var step2 = new WizardStep { Title = "step2" };
  91. wizard.AddStep (step2);
  92. Assert.Equal (step1.Title, wizard.GetFirstStep ().Title);
  93. var step3 = new WizardStep { Title = "step3" };
  94. wizard.AddStep (step3);
  95. Assert.Equal (step1.Title, wizard.GetFirstStep ().Title);
  96. step1.Enabled = false;
  97. Assert.Equal (step2.Title, wizard.GetFirstStep ().Title);
  98. step1.Enabled = true;
  99. Assert.Equal (step1.Title, wizard.GetFirstStep ().Title);
  100. step1.Enabled = false;
  101. step2.Enabled = false;
  102. Assert.Equal (step3.Title, wizard.GetFirstStep ().Title);
  103. wizard.Dispose ();
  104. }
  105. [Fact]
  106. public void Navigate_GetLastStep_Works ()
  107. {
  108. var wizard = new Wizard ();
  109. Assert.Null (wizard.GetLastStep ());
  110. var step1 = new WizardStep { Title = "step1" };
  111. wizard.AddStep (step1);
  112. Assert.Equal (step1.Title, wizard.GetLastStep ().Title);
  113. var step2 = new WizardStep { Title = "step2" };
  114. wizard.AddStep (step2);
  115. Assert.Equal (step2.Title, wizard.GetLastStep ().Title);
  116. var step3 = new WizardStep { Title = "step3" };
  117. wizard.AddStep (step3);
  118. Assert.Equal (step3.Title, wizard.GetLastStep ().Title);
  119. step3.Enabled = false;
  120. Assert.Equal (step2.Title, wizard.GetLastStep ().Title);
  121. step3.Enabled = true;
  122. Assert.Equal (step3.Title, wizard.GetLastStep ().Title);
  123. step3.Enabled = false;
  124. step2.Enabled = false;
  125. Assert.Equal (step1.Title, wizard.GetLastStep ().Title);
  126. wizard.Dispose ();
  127. }
  128. [Fact]
  129. [AutoInitShutdown]
  130. public void Navigate_GetNextStep_Correct ()
  131. {
  132. var wizard = new Wizard ();
  133. // If no steps should be null
  134. Assert.Null (wizard.GetNextStep ());
  135. var step1 = new WizardStep { Title = "step1" };
  136. wizard.AddStep (step1);
  137. // If no current step, should be first step
  138. Assert.Equal (step1.Title, wizard.GetNextStep ().Title);
  139. wizard.CurrentStep = step1;
  140. // If there is 1 step it's current step should be null
  141. Assert.Null (wizard.GetNextStep ());
  142. // If one disabled step should be null
  143. step1.Enabled = false;
  144. Assert.Null (wizard.GetNextStep ());
  145. // If two steps and at 1 and step 2 is `Enabled = true`should be step 2
  146. var step2 = new WizardStep { Title = "step2" };
  147. wizard.AddStep (step2);
  148. Assert.Equal (step2.Title, wizard.GetNextStep ().Title);
  149. // If two steps and at 1 and step 2 is `Enabled = false` should be null
  150. step1.Enabled = true;
  151. wizard.CurrentStep = step1;
  152. step2.Enabled = false;
  153. Assert.Null (wizard.GetNextStep ());
  154. // If three steps with Step2.Enabled = true
  155. // At step 1 should be step 2
  156. // At step 2 should be step 3
  157. // At step 3 should be null
  158. var step3 = new WizardStep { Title = "step3" };
  159. wizard.AddStep (step3);
  160. step1.Enabled = true;
  161. wizard.CurrentStep = step1;
  162. step2.Enabled = true;
  163. step3.Enabled = true;
  164. Assert.Equal (step2.Title, wizard.GetNextStep ().Title);
  165. wizard.CurrentStep = step2;
  166. Assert.Equal (step3.Title, wizard.GetNextStep ().Title);
  167. wizard.CurrentStep = step3;
  168. Assert.Null (wizard.GetNextStep ());
  169. // If three steps with Step2.Enabled = false
  170. // At step 1 should be step 3
  171. // At step 3 should be null
  172. step1.Enabled = true;
  173. wizard.CurrentStep = step1;
  174. step2.Enabled = false;
  175. step3.Enabled = true;
  176. Assert.Equal (step3.Title, wizard.GetNextStep ().Title);
  177. wizard.CurrentStep = step3;
  178. Assert.Null (wizard.GetNextStep ());
  179. // If three steps with Step2.Enabled = false & Step3.Enabled = false
  180. // At step 1 should be null
  181. step1.Enabled = true;
  182. wizard.CurrentStep = step1;
  183. step2.Enabled = false;
  184. step3.Enabled = false;
  185. Assert.Null (wizard.GetNextStep ());
  186. // If no current step, GetNextStep provides equivalent to GetFirstStep
  187. wizard.CurrentStep = null;
  188. step1.Enabled = true;
  189. step2.Enabled = true;
  190. step3.Enabled = true;
  191. Assert.Equal (step1.Title, wizard.GetNextStep ().Title);
  192. step1.Enabled = false;
  193. step2.Enabled = true;
  194. step3.Enabled = true;
  195. Assert.Equal (step2.Title, wizard.GetNextStep ().Title);
  196. step1.Enabled = false;
  197. step2.Enabled = false;
  198. step3.Enabled = true;
  199. Assert.Equal (step3.Title, wizard.GetNextStep ().Title);
  200. step1.Enabled = false;
  201. step2.Enabled = true;
  202. step3.Enabled = false;
  203. Assert.Equal (step2.Title, wizard.GetNextStep ().Title);
  204. step1.Enabled = true;
  205. step2.Enabled = false;
  206. step3.Enabled = false;
  207. Assert.Equal (step1.Title, wizard.GetNextStep ().Title);
  208. wizard.Dispose ();
  209. }
  210. [Fact]
  211. [AutoInitShutdown]
  212. public void Navigate_GetPreviousStep_Correct ()
  213. {
  214. var wizard = new Wizard ();
  215. // If no steps should be null
  216. Assert.Null (wizard.GetPreviousStep ());
  217. var step1 = new WizardStep { Title = "step1" };
  218. wizard.AddStep (step1);
  219. // If no current step, should be last step
  220. Assert.Equal (step1.Title, wizard.GetPreviousStep ().Title);
  221. wizard.CurrentStep = step1;
  222. // If there is 1 step it's current step should be null
  223. Assert.Null (wizard.GetPreviousStep ());
  224. // If one disabled step should be null
  225. step1.Enabled = false;
  226. Assert.Null (wizard.GetPreviousStep ());
  227. // If two steps and at 2 and step 1 is `Enabled = true`should be step1
  228. var step2 = new WizardStep { Title = "step2" };
  229. wizard.AddStep (step2);
  230. wizard.CurrentStep = step2;
  231. step1.Enabled = true;
  232. Assert.Equal (step1.Title, wizard.GetPreviousStep ().Title);
  233. // If two steps and at 2 and step 1 is `Enabled = false` should be null
  234. step1.Enabled = false;
  235. Assert.Null (wizard.GetPreviousStep ());
  236. // If three steps with Step2.Enabled = true
  237. // At step 1 should be null
  238. // At step 2 should be step 1
  239. // At step 3 should be step 2
  240. var step3 = new WizardStep { Title = "step3" };
  241. wizard.AddStep (step3);
  242. step1.Enabled = true;
  243. wizard.CurrentStep = step1;
  244. step2.Enabled = true;
  245. step3.Enabled = true;
  246. Assert.Null (wizard.GetPreviousStep ());
  247. wizard.CurrentStep = step2;
  248. Assert.Equal (step1.Title, wizard.GetPreviousStep ().Title);
  249. wizard.CurrentStep = step3;
  250. Assert.Equal (step2.Title, wizard.GetPreviousStep ().Title);
  251. // If three steps with Step2.Enabled = false
  252. // At step 1 should be null
  253. // At step 3 should be step1
  254. step1.Enabled = true;
  255. step2.Enabled = false;
  256. step3.Enabled = true;
  257. wizard.CurrentStep = step1;
  258. Assert.Null (wizard.GetPreviousStep ());
  259. wizard.CurrentStep = step3;
  260. Assert.Equal (step1.Title, wizard.GetPreviousStep ().Title);
  261. // If three steps with Step1.Enabled = false & Step2.Enabled = false
  262. // At step 3 should be null
  263. // If no current step, GetPreviousStep provides equivalent to GetLastStep
  264. wizard.CurrentStep = null;
  265. step1.Enabled = true;
  266. step2.Enabled = true;
  267. step3.Enabled = true;
  268. Assert.Equal (step3.Title, wizard.GetPreviousStep ().Title);
  269. step1.Enabled = false;
  270. step2.Enabled = true;
  271. step3.Enabled = true;
  272. Assert.Equal (step3.Title, wizard.GetPreviousStep ().Title);
  273. step1.Enabled = false;
  274. step2.Enabled = false;
  275. step3.Enabled = true;
  276. Assert.Equal (step3.Title, wizard.GetPreviousStep ().Title);
  277. step1.Enabled = false;
  278. step2.Enabled = true;
  279. step3.Enabled = false;
  280. Assert.Equal (step2.Title, wizard.GetPreviousStep ().Title);
  281. step1.Enabled = true;
  282. step2.Enabled = false;
  283. step3.Enabled = false;
  284. Assert.Equal (step1.Title, wizard.GetPreviousStep ().Title);
  285. wizard.Dispose ();
  286. }
  287. [Fact]
  288. public void Navigate_GoBack_Works ()
  289. {
  290. // If zero steps do nothing
  291. // If one step do nothing (enabled or disabled)
  292. // If two steps
  293. // If current is 1 does nothing
  294. // If current is 2 does nothing
  295. // If 1 is enabled 2 becomes current
  296. // If 1 is disabled 1 stays current
  297. }
  298. [Fact]
  299. public void Navigate_GoNext_Works ()
  300. {
  301. // If zero steps do nothing
  302. // If one step do nothing (enabled or disabled)
  303. // If two steps
  304. // If current is 1
  305. // If 2 is enabled 2 becomes current
  306. // If 2 is disabled 1 stays current
  307. // If current is 2 does nothing
  308. }
  309. [Fact]
  310. [AutoInitShutdown]
  311. // This test verifies that a single step wizard shows the correct buttons
  312. // and that the title is correct
  313. public void OneStepWizard_Shows ()
  314. {
  315. var title = "1234";
  316. var stepTitle = "ABCD";
  317. var width = 30;
  318. var height = 7;
  319. AutoInitShutdownAttribute.FakeResize (new Size (width, height));
  320. // var btnBackText = "Back";
  321. var btnBack = string.Empty; // $"{Glyphs.LeftBracket} {btnBackText} {Glyphs.RightBracket}";
  322. var btnNextText = "Finish"; // "Next";
  323. var btnNext =
  324. $"{
  325. Glyphs.LeftBracket
  326. }{
  327. Glyphs.LeftDefaultIndicator
  328. } {
  329. btnNextText
  330. } {
  331. Glyphs.RightDefaultIndicator
  332. }{
  333. Glyphs.RightBracket
  334. }";
  335. var topRow =
  336. $"{
  337. Glyphs.ULCornerDbl
  338. }╡{
  339. title
  340. } - {
  341. stepTitle
  342. }╞{
  343. new (Glyphs.HLineDbl.ToString () [0], width - title.Length - stepTitle.Length - 7)
  344. }{
  345. Glyphs.URCornerDbl
  346. }";
  347. var row2 = $"{Glyphs.VLineDbl}{new (' ', width - 2)}{Glyphs.VLineDbl}";
  348. string row3 = row2;
  349. string row4 = row3;
  350. var separatorRow =
  351. $"{Glyphs.VLineDbl}{new (Glyphs.HLine.ToString () [0], width - 2)}{Glyphs.VLineDbl}";
  352. var buttonRow =
  353. $"{
  354. Glyphs.VLineDbl
  355. }{
  356. btnBack
  357. }{
  358. new (' ', width - btnBack.Length - btnNext.Length - 2)
  359. }{
  360. btnNext
  361. }{
  362. Glyphs.VLineDbl
  363. }";
  364. var bottomRow =
  365. $"{
  366. Glyphs.LLCornerDbl
  367. }{
  368. new (Glyphs.HLineDbl.ToString () [0], width - 2)
  369. }{
  370. Glyphs.LRCornerDbl
  371. }";
  372. Wizard wizard = new () { Title = title, Width = width, Height = height };
  373. wizard.AddStep (new() { Title = stepTitle });
  374. //wizard.LayoutSubViews ();
  375. RunState runstate = Application.Begin (wizard);
  376. AutoInitShutdownAttribute.RunIteration ();
  377. // TODO: Disabled until Dim.Auto is used in Dialog
  378. //DriverAsserts.AssertDriverContentsWithFrameAre (
  379. // $"{topRow}\n{row2}\n{row3}\n{row4}\n{separatorRow}\n{buttonRow}\n{bottomRow}",
  380. // _output
  381. // );
  382. Application.End (runstate);
  383. wizard.Dispose ();
  384. }
  385. [Fact]
  386. [AutoInitShutdown]
  387. // this test is needed because Wizard overrides Dialog's title behavior ("Title - StepTitle")
  388. public void Setting_Title_Works ()
  389. {
  390. var d = (IConsoleDriverFacade)Application.Driver;
  391. var title = "1234";
  392. var stepTitle = " - ABCD";
  393. var width = 40;
  394. var height = 4;
  395. d.OutputBuffer.SetWindowSize (width,height);
  396. var btnNextText = "Finish";
  397. var btnNext =
  398. $"{
  399. Glyphs.LeftBracket
  400. }{
  401. Glyphs.LeftDefaultIndicator
  402. } {
  403. btnNextText
  404. } {
  405. Glyphs.RightDefaultIndicator
  406. }{
  407. Glyphs.RightBracket
  408. }";
  409. var topRow =
  410. $"{
  411. Glyphs.ULCornerDbl
  412. }╡{
  413. title
  414. }{
  415. stepTitle
  416. }╞{
  417. new (Glyphs.HLineDbl.ToString () [0], width - title.Length - stepTitle.Length - 4)
  418. }{
  419. Glyphs.URCornerDbl
  420. }";
  421. var separatorRow =
  422. $"{Glyphs.VLineDbl}{new (Glyphs.HLine.ToString () [0], width - 2)}{Glyphs.VLineDbl}";
  423. // Once this is fixed, revert to commented out line: https://github.com/gui-cs/Terminal.Gui/issues/1791
  424. var buttonRow =
  425. $"{Glyphs.VLineDbl}{new (' ', width - btnNext.Length - 2)}{btnNext}{Glyphs.VLineDbl}";
  426. //var buttonRow = $"{Glyphs.VDLine}{new String (' ', width - btnNext.Length - 2)}{btnNext}{Glyphs.VDLine}";
  427. var bottomRow =
  428. $"{
  429. Glyphs.LLCornerDbl
  430. }{
  431. new (Glyphs.HLineDbl.ToString () [0], width - 2)
  432. }{
  433. Glyphs.LRCornerDbl
  434. }";
  435. var wizard = new Wizard { Title = title, Width = width, Height = height };
  436. wizard.AddStep (new() { Title = "ABCD" });
  437. Application.End (Application.Begin (wizard));
  438. wizard.Dispose ();
  439. }
  440. [Fact]
  441. // This test verifies that the 2nd step in a wizard with more than 2 steps
  442. // shows the correct buttons on all steps
  443. // and that the title is correct
  444. public void ThreeStepWizard_Next_Shows_Steps ()
  445. {
  446. // verify step one
  447. // Next
  448. // verify step two
  449. // Back
  450. // verify step one again
  451. }
  452. [Fact]
  453. // This test verifies that the 2nd step in a wizard with 2 steps
  454. // shows the correct buttons on both steps
  455. // and that the title is correct
  456. public void TwoStepWizard_Next_Shows_SecondStep ()
  457. {
  458. // verify step one
  459. // Next
  460. // verify step two
  461. // Back
  462. // verify step one again
  463. }
  464. // =========== WizardStep Tests
  465. [Fact]
  466. public void WizardStep_ButtonText ()
  467. {
  468. // Verify default button text
  469. // Verify set actually changes property
  470. // Verify set actually changes buttons for the current step
  471. }
  472. [Fact]
  473. public void WizardStep_Set_Title_Fires_TitleChanged ()
  474. {
  475. var r = new Window ();
  476. Assert.Equal (string.Empty, r.Title);
  477. var expected = string.Empty;
  478. r.TitleChanged += (s, args) => { Assert.Equal (r.Title, args.Value); };
  479. expected = "title";
  480. r.Title = expected;
  481. Assert.Equal (expected, r.Title);
  482. expected = "another title";
  483. r.Title = expected;
  484. Assert.Equal (expected, r.Title);
  485. r.Dispose ();
  486. }
  487. [Fact]
  488. public void WizardStep_Set_Title_Fires_TitleChanging ()
  489. {
  490. var r = new Window ();
  491. Assert.Equal (string.Empty, r.Title);
  492. var expectedAfter = string.Empty;
  493. var expectedDuring = string.Empty;
  494. var cancel = false;
  495. r.TitleChanging += (s, args) =>
  496. {
  497. Assert.Equal (expectedDuring, args.NewValue);
  498. args.Cancel = cancel;
  499. };
  500. r.Title = expectedDuring = expectedAfter = "title";
  501. Assert.Equal (expectedAfter, r.Title);
  502. r.Title = expectedDuring = expectedAfter = "a different title";
  503. Assert.Equal (expectedAfter, r.Title);
  504. // Now setup cancelling the change and change it back to "title"
  505. cancel = true;
  506. r.Title = expectedDuring = "title";
  507. Assert.Equal (expectedAfter, r.Title);
  508. r.Dispose ();
  509. }
  510. [Fact]
  511. [AutoInitShutdown]
  512. // Verify a zero-step wizard doesn't crash and shows a blank wizard
  513. // and that the title is correct
  514. public void ZeroStepWizard_Shows ()
  515. {
  516. var title = "1234";
  517. var stepTitle = "";
  518. var width = 30;
  519. var height = 6;
  520. AutoInitShutdownAttribute.FakeResize (new Size (width, height));
  521. var btnBackText = "Back";
  522. var btnBack = $"{Glyphs.LeftBracket} {btnBackText} {Glyphs.RightBracket}";
  523. var btnNextText = "Finish";
  524. var btnNext =
  525. $"{
  526. Glyphs.LeftBracket
  527. }{
  528. Glyphs.LeftDefaultIndicator
  529. } {
  530. btnNextText
  531. } {
  532. Glyphs.RightDefaultIndicator
  533. }{
  534. Glyphs.RightBracket
  535. }";
  536. var topRow =
  537. $"{
  538. Glyphs.ULCornerDbl
  539. }╡{
  540. title
  541. }{
  542. stepTitle
  543. }╞{
  544. new (Glyphs.HLineDbl.ToString () [0], width - title.Length - stepTitle.Length - 4)
  545. }{
  546. Glyphs.URCornerDbl
  547. }";
  548. var row2 = $"{Glyphs.VLineDbl}{new (' ', width - 2)}{Glyphs.VLineDbl}";
  549. string row3 = row2;
  550. var separatorRow =
  551. $"{Glyphs.VLineDbl}{new (Glyphs.HLine.ToString () [0], width - 2)}{Glyphs.VLineDbl}";
  552. var buttonRow =
  553. $"{
  554. Glyphs.VLineDbl
  555. }{
  556. btnBack
  557. }{
  558. new (' ', width - btnBack.Length - btnNext.Length - 2)
  559. }{
  560. btnNext
  561. }{
  562. Glyphs.VLineDbl
  563. }";
  564. var bottomRow =
  565. $"{
  566. Glyphs.LLCornerDbl
  567. }{
  568. new (Glyphs.HLineDbl.ToString () [0], width - 2)
  569. }{
  570. Glyphs.LRCornerDbl
  571. }";
  572. var wizard = new Wizard { Title = title, Width = width, Height = height };
  573. RunState runstate = Application.Begin (wizard);
  574. // TODO: Disabled until Dim.Auto is used in Dialog
  575. //DriverAsserts.AssertDriverContentsWithFrameAre (
  576. // $"{topRow}\n{row2}\n{row3}\n{separatorRow}\n{buttonRow}\n{bottomRow}",
  577. // _output
  578. // );
  579. Application.End (runstate);
  580. wizard.Dispose ();
  581. }
  582. }