Skip to content

Commit 4aa5590

Browse files
committed
Merge branch '39-convert-statusbartests-to-constraint-model' into convert-unit-tests-to-constraint-model-5
* 39-convert-statusbartests-to-constraint-model: This one can safely run in parallel Convert this fixture Finishes #39
2 parents 55259a8 + cd6ec78 commit 4aa5590

1 file changed

Lines changed: 16 additions & 17 deletions

File tree

tests/StatusBarTests.cs

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
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

Comments
 (0)