Skip to content

Commit ae4ec45

Browse files
Display names and indent correction
1 parent 3fc947b commit ae4ec45

File tree

1 file changed

+10
-22
lines changed

1 file changed

+10
-22
lines changed

src/System.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/ToolStripContainerActionListTests.cs

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -153,14 +153,10 @@ public void GetSortedActionItems_ReturnsCorrectItems_WhenDockNotFilled()
153153
{
154154
DesignerActionItemCollection items = _actionList.GetSortedActionItems();
155155
List<string> displayNames = items.Cast<DesignerActionItem>()
156-
.Select(i => i.DisplayName ?? string.Empty)
157-
.ToList();
156+
.Select(i => i.DisplayName ?? string.Empty)
157+
.ToList();
158158

159-
displayNames.Should().ContainSingle(name => name == "Top");
160-
displayNames.Should().ContainSingle(name => name == "Bottom");
161-
displayNames.Should().ContainSingle(name => name == "Left");
162-
displayNames.Should().ContainSingle(name => name == "Right");
163-
displayNames.Should().ContainSingle(name => name == "Dock Fill in Form");
159+
displayNames.Should().Contain(new[] { SR.ToolStripContainerActionList_Top, SR.ToolStripContainerActionList_Bottom, SR.ToolStripContainerActionList_Left, SR.ToolStripContainerActionList_Right, SR.DesignerShortcutDockInForm });
164160
}
165161

166162
[Fact]
@@ -171,14 +167,10 @@ public void GetSortedActionItems_ReturnsCorrectItems_WhenDockFilled()
171167

172168
DesignerActionItemCollection items = _actionList.GetSortedActionItems();
173169
List<string> displayNames = items.Cast<DesignerActionItem>()
174-
.Select(i => i.DisplayName ?? string.Empty)
175-
.ToList();
170+
.Select(i => i.DisplayName ?? string.Empty)
171+
.ToList();
176172

177-
displayNames.Should().ContainSingle(name => name == "Top");
178-
displayNames.Should().ContainSingle(name => name == "Bottom");
179-
displayNames.Should().ContainSingle(name => name == "Left");
180-
displayNames.Should().ContainSingle(name => name == "Right");
181-
displayNames.Should().NotContain(name => name == "Dock in Form");
173+
displayNames.Should().Contain(new[] { SR.ToolStripContainerActionList_Top, SR.ToolStripContainerActionList_Bottom, SR.ToolStripContainerActionList_Left, SR.ToolStripContainerActionList_Right });
182174
}
183175

184176
[Fact]
@@ -194,13 +186,9 @@ public void GetSortedActionItems_ReturnsCorrectItems_WhenProvideReparent()
194186

195187
DesignerActionItemCollection items = _actionList.GetSortedActionItems();
196188
List<string> displayNames = items.Cast<DesignerActionItem>()
197-
.Select(i => i.DisplayName ?? string.Empty)
198-
.ToList();
199-
200-
displayNames.Should().ContainSingle(name => name == "Top");
201-
displayNames.Should().ContainSingle(name => name == "Bottom");
202-
displayNames.Should().ContainSingle(name => name == "Left");
203-
displayNames.Should().ContainSingle(name => name == "Right");
204-
displayNames.Should().ContainSingle(name => name == "Re-parent Controls");
189+
.Select(i => i.DisplayName ?? string.Empty)
190+
.ToList();
191+
192+
displayNames.Should().Contain(new[] { SR.ToolStripContainerActionList_Top, SR.ToolStripContainerActionList_Bottom, SR.ToolStripContainerActionList_Left, SR.ToolStripContainerActionList_Right, SR.DesignerShortcutReparentControls });
205193
}
206194
}

0 commit comments

Comments
 (0)