WizardTests.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726
  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 d = (FakeDriver)Application.Driver;
  319. var title = "1234";
  320. var stepTitle = "ABCD";
  321. var width = 30;
  322. var height = 7;
  323. d.SetBufferSize (width, height);
  324. // var btnBackText = "Back";
  325. var btnBack = string.Empty; // $"{Glyphs.LeftBracket} {btnBackText} {Glyphs.RightBracket}";
  326. var btnNextText = "Finish"; // "Next";
  327. var btnNext =
  328. $"{
  329. Glyphs.LeftBracket
  330. }{
  331. Glyphs.LeftDefaultIndicator
  332. } {
  333. btnNextText
  334. } {
  335. Glyphs.RightDefaultIndicator
  336. }{
  337. Glyphs.RightBracket
  338. }";
  339. var topRow =
  340. $"{
  341. Glyphs.ULCornerDbl
  342. }╡{
  343. title
  344. } - {
  345. stepTitle
  346. }╞{
  347. new (Glyphs.HLineDbl.ToString () [0], width - title.Length - stepTitle.Length - 7)
  348. }{
  349. Glyphs.URCornerDbl
  350. }";
  351. var row2 = $"{Glyphs.VLineDbl}{new (' ', width - 2)}{Glyphs.VLineDbl}";
  352. string row3 = row2;
  353. string row4 = row3;
  354. var separatorRow =
  355. $"{Glyphs.VLineDbl}{new (Glyphs.HLine.ToString () [0], width - 2)}{Glyphs.VLineDbl}";
  356. var buttonRow =
  357. $"{
  358. Glyphs.VLineDbl
  359. }{
  360. btnBack
  361. }{
  362. new (' ', width - btnBack.Length - btnNext.Length - 2)
  363. }{
  364. btnNext
  365. }{
  366. Glyphs.VLineDbl
  367. }";
  368. var bottomRow =
  369. $"{
  370. Glyphs.LLCornerDbl
  371. }{
  372. new (Glyphs.HLineDbl.ToString () [0], width - 2)
  373. }{
  374. Glyphs.LRCornerDbl
  375. }";
  376. var wizard = new Wizard { Title = title, Width = width, Height = height };
  377. wizard.AddStep (new() { Title = stepTitle });
  378. //wizard.LayoutSubViews ();
  379. var firstIteration = false;
  380. RunState runstate = Application.Begin (wizard);
  381. Application.RunIteration (ref runstate, firstIteration);
  382. // TODO: Disabled until Dim.Auto is used in Dialog
  383. //DriverAsserts.AssertDriverContentsWithFrameAre (
  384. // $"{topRow}\n{row2}\n{row3}\n{row4}\n{separatorRow}\n{buttonRow}\n{bottomRow}",
  385. // _output
  386. // );
  387. Application.End (runstate);
  388. wizard.Dispose ();
  389. }
  390. [Fact]
  391. [AutoInitShutdown]
  392. // this test is needed because Wizard overrides Dialog's title behavior ("Title - StepTitle")
  393. public void Setting_Title_Works ()
  394. {
  395. var d = (FakeDriver)Application.Driver;
  396. var title = "1234";
  397. var stepTitle = " - ABCD";
  398. var width = 40;
  399. var height = 4;
  400. d.SetBufferSize (width, height);
  401. var btnNextText = "Finish";
  402. var btnNext =
  403. $"{
  404. Glyphs.LeftBracket
  405. }{
  406. Glyphs.LeftDefaultIndicator
  407. } {
  408. btnNextText
  409. } {
  410. Glyphs.RightDefaultIndicator
  411. }{
  412. Glyphs.RightBracket
  413. }";
  414. var topRow =
  415. $"{
  416. Glyphs.ULCornerDbl
  417. }╡{
  418. title
  419. }{
  420. stepTitle
  421. }╞{
  422. new (Glyphs.HLineDbl.ToString () [0], width - title.Length - stepTitle.Length - 4)
  423. }{
  424. Glyphs.URCornerDbl
  425. }";
  426. var separatorRow =
  427. $"{Glyphs.VLineDbl}{new (Glyphs.HLine.ToString () [0], width - 2)}{Glyphs.VLineDbl}";
  428. // Once this is fixed, revert to commented out line: https://github.com/gui-cs/Terminal.Gui/issues/1791
  429. var buttonRow =
  430. $"{Glyphs.VLineDbl}{new (' ', width - btnNext.Length - 2)}{btnNext}{Glyphs.VLineDbl}";
  431. //var buttonRow = $"{Glyphs.VDLine}{new String (' ', width - btnNext.Length - 2)}{btnNext}{Glyphs.VDLine}";
  432. var bottomRow =
  433. $"{
  434. Glyphs.LLCornerDbl
  435. }{
  436. new (Glyphs.HLineDbl.ToString () [0], width - 2)
  437. }{
  438. Glyphs.LRCornerDbl
  439. }";
  440. var wizard = new Wizard { Title = title, Width = width, Height = height };
  441. wizard.AddStep (new() { Title = "ABCD" });
  442. Application.End (Application.Begin (wizard));
  443. wizard.Dispose ();
  444. }
  445. [Fact]
  446. // This test verifies that the 2nd step in a wizard with more than 2 steps
  447. // shows the correct buttons on all steps
  448. // and that the title is correct
  449. public void ThreeStepWizard_Next_Shows_Steps ()
  450. {
  451. // verify step one
  452. // Next
  453. // verify step two
  454. // Back
  455. // verify step one again
  456. }
  457. [Fact]
  458. // This test verifies that the 2nd step in a wizard with 2 steps
  459. // shows the correct buttons on both steps
  460. // and that the title is correct
  461. public void TwoStepWizard_Next_Shows_SecondStep ()
  462. {
  463. // verify step one
  464. // Next
  465. // verify step two
  466. // Back
  467. // verify step one again
  468. }
  469. // =========== WizardStep Tests
  470. [Fact]
  471. public void WizardStep_ButtonText ()
  472. {
  473. // Verify default button text
  474. // Verify set actually changes property
  475. // Verify set actually changes buttons for the current step
  476. }
  477. [Fact]
  478. public void WizardStep_Set_Title_Fires_TitleChanged ()
  479. {
  480. var r = new Window ();
  481. Assert.Equal (string.Empty, r.Title);
  482. var expected = string.Empty;
  483. r.TitleChanged += (s, args) => { Assert.Equal (r.Title, args.CurrentValue); };
  484. expected = "title";
  485. r.Title = expected;
  486. Assert.Equal (expected, r.Title);
  487. expected = "another title";
  488. r.Title = expected;
  489. Assert.Equal (expected, r.Title);
  490. r.Dispose ();
  491. }
  492. [Fact]
  493. public void WizardStep_Set_Title_Fires_TitleChanging ()
  494. {
  495. var r = new Window ();
  496. Assert.Equal (string.Empty, r.Title);
  497. var expectedAfter = string.Empty;
  498. var expectedDuring = string.Empty;
  499. var cancel = false;
  500. r.TitleChanging += (s, args) =>
  501. {
  502. Assert.Equal (expectedDuring, args.NewValue);
  503. args.Cancel = cancel;
  504. };
  505. r.Title = expectedDuring = expectedAfter = "title";
  506. Assert.Equal (expectedAfter, r.Title);
  507. r.Title = expectedDuring = expectedAfter = "a different title";
  508. Assert.Equal (expectedAfter, r.Title);
  509. // Now setup cancelling the change and change it back to "title"
  510. cancel = true;
  511. r.Title = expectedDuring = "title";
  512. Assert.Equal (expectedAfter, r.Title);
  513. r.Dispose ();
  514. }
  515. [Fact]
  516. [AutoInitShutdown]
  517. // Verify a zero-step wizard doesn't crash and shows a blank wizard
  518. // and that the title is correct
  519. public void ZeroStepWizard_Shows ()
  520. {
  521. var d = (FakeDriver)Application.Driver;
  522. var title = "1234";
  523. var stepTitle = "";
  524. var width = 30;
  525. var height = 6;
  526. d.SetBufferSize (width, height);
  527. var btnBackText = "Back";
  528. var btnBack = $"{Glyphs.LeftBracket} {btnBackText} {Glyphs.RightBracket}";
  529. var btnNextText = "Finish";
  530. var btnNext =
  531. $"{
  532. Glyphs.LeftBracket
  533. }{
  534. Glyphs.LeftDefaultIndicator
  535. } {
  536. btnNextText
  537. } {
  538. Glyphs.RightDefaultIndicator
  539. }{
  540. Glyphs.RightBracket
  541. }";
  542. var topRow =
  543. $"{
  544. Glyphs.ULCornerDbl
  545. }╡{
  546. title
  547. }{
  548. stepTitle
  549. }╞{
  550. new (Glyphs.HLineDbl.ToString () [0], width - title.Length - stepTitle.Length - 4)
  551. }{
  552. Glyphs.URCornerDbl
  553. }";
  554. var row2 = $"{Glyphs.VLineDbl}{new (' ', width - 2)}{Glyphs.VLineDbl}";
  555. string row3 = row2;
  556. var separatorRow =
  557. $"{Glyphs.VLineDbl}{new (Glyphs.HLine.ToString () [0], width - 2)}{Glyphs.VLineDbl}";
  558. var buttonRow =
  559. $"{
  560. Glyphs.VLineDbl
  561. }{
  562. btnBack
  563. }{
  564. new (' ', width - btnBack.Length - btnNext.Length - 2)
  565. }{
  566. btnNext
  567. }{
  568. Glyphs.VLineDbl
  569. }";
  570. var bottomRow =
  571. $"{
  572. Glyphs.LLCornerDbl
  573. }{
  574. new (Glyphs.HLineDbl.ToString () [0], width - 2)
  575. }{
  576. Glyphs.LRCornerDbl
  577. }";
  578. var wizard = new Wizard { Title = title, Width = width, Height = height };
  579. RunState runstate = Application.Begin (wizard);
  580. // TODO: Disabled until Dim.Auto is used in Dialog
  581. //DriverAsserts.AssertDriverContentsWithFrameAre (
  582. // $"{topRow}\n{row2}\n{row3}\n{separatorRow}\n{buttonRow}\n{bottomRow}",
  583. // _output
  584. // );
  585. Application.End (runstate);
  586. wizard.Dispose ();
  587. }
  588. }