WizardTests.cs 22 KB

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