1- using Terminal . Gui ;
2- using TerminalGuiDesigner ;
1+ namespace UnitTests ;
32
4- namespace UnitTests
3+ [ TestFixture ]
4+ [ Category ( "Code Generation" ) ]
5+ [ Parallelizable ( ParallelScope . All ) ]
6+ internal class StatusBarTests : Tests
57{
6- internal class StatusBarTests : Tests
8+ [ Test ]
9+ public void ItemsArePreserved ( )
710 {
8- [ Test ]
9- public void TestItemsArePreserved ( )
10- {
11- Key shortcutBefore = KeyCode . Null ;
11+ Key shortcutBefore = KeyCode . Null ;
1212
13- var statusBarIn = RoundTrip < Toplevel , StatusBar > ( ( d , v ) =>
14- {
15- ClassicAssert . AreEqual ( 1 , v . Items . Length , $ "Expected { nameof ( ViewFactory ) } to create a placeholder status item in new StatusBars it creates") ;
16- shortcutBefore = v . Items [ 0 ] . Shortcut ;
13+ using StatusBar statusBarIn = RoundTrip < Toplevel , StatusBar > ( ( _ , v ) =>
14+ {
15+ Assert . That ( v . Items , Has . Length . EqualTo ( 1 ) , $ "Expected { nameof ( ViewFactory ) } to create a placeholder status item in new StatusBars it creates" ) ;
16+ shortcutBefore = v . Items [ 0 ] . Shortcut ;
1717
18- } , out _ ) ;
18+ } , out _ ) ;
1919
20- ClassicAssert . AreEqual ( 1 , statusBarIn . Items . Length , "Expected reloading StatusBar to create the same number of StatusItems" ) ;
21- ClassicAssert . AreEqual ( shortcutBefore , statusBarIn . Items [ 0 ] . Shortcut ) ;
22- }
20+ Assert . That ( statusBarIn . Items , Has . Length . EqualTo ( 1 ) , "Expected reloading StatusBar to create the same number of StatusItems" ) ;
21+ Assert . That ( statusBarIn . Items [ 0 ] . Shortcut , Is . EqualTo ( shortcutBefore ) ) ;
2322 }
24- }
23+ }
0 commit comments