Skip to content

Commit 8252001

Browse files
author
tznind
committed
Test fixes
1 parent 98295e9 commit 8252001

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

src/StatusBarExtensions.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,14 @@ public static Shortcut[] GetShortcuts(this StatusBar bar)
7575

7676
public static void SetShortcuts(this StatusBar bar, Shortcut[] shortcuts)
7777
{
78-
bar.Subviews.Clear();
78+
foreach(var old in bar.GetShortcuts())
79+
{
80+
bar.Remove(old);
81+
}
7982

8083
foreach (var shortcut in shortcuts)
8184
{
82-
bar.Subviews.Add(shortcut);
85+
bar.Add(shortcut);
8386
}
8487
}
8588
}

src/ViewFactory.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ public static class ViewFactory
3939

4040
// BUG These seem to cause stack overflows in CreateSubControlDesigns (see TestAddView_RoundTrip)
4141
typeof( Wizard ),
42-
typeof( WizardStep )
42+
typeof( WizardStep ),
43+
44+
// TODO: Requires tests and comprehensive testing, also its generic so that's more complicated
45+
typeof(NumericUpDown),
46+
typeof(NumericUpDown<>)
4347
];
4448

4549
/// <summary>

tests/ListViewTests.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ public void TestIListSourceProperty_Rhs( )
8181
var code = Helpers.ExpressionToCode( prop.GetRhs( ) );
8282

8383
Assert.That(
84-
code, Is.EqualTo( "new Terminal.Gui.ListWrapper(new string[] {\n \"hi there\",\n \"my friend\"})".Replace( "\n", Environment.NewLine ) ) );
84+
code.Trim().ReplaceLineEndings("\n"), Is.EqualTo(
85+
@"
86+
new Terminal.Gui.ListWrapper<string>(new System.Collections.ObjectModel.ObservableCollection<string>(new string[] {
87+
""hi there"",
88+
""my friend""}))".Trim().ReplaceLineEndings("\n")));
8589
}
8690
}

0 commit comments

Comments
 (0)