-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
...Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/ComboBoxDesignerTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace System.Windows.Forms.Design.Tests.System.Windows.Forms.Design; | ||
|
||
public sealed class ComboBoxDesignerTests | ||
{ | ||
[Fact] | ||
public void AutoResizeHandles_WithInitialize_ShouldBeTrue() | ||
{ | ||
using ComboBoxDesigner comboBoxDesigner = new(); | ||
using ComboBox comboBox = new(); | ||
comboBoxDesigner.Initialize(comboBox); | ||
|
||
comboBoxDesigner.AutoResizeHandles.Should().BeTrue(); | ||
} | ||
|
||
[Fact] | ||
public void SnapLines_WithDefaultComboBox_ShouldReturnExpectedCount() | ||
{ | ||
using ComboBoxDesigner comboBoxDesigner = new(); | ||
using ComboBox comboBox = new(); | ||
comboBoxDesigner.Initialize(comboBox); | ||
|
||
comboBoxDesigner.SnapLines.Count.Should().Be(9); | ||
} | ||
|
||
[Fact] | ||
public void SelectionRules_WithDefaultComboBox_ShouldThrowNullReferenceException() | ||
{ | ||
using ComboBoxDesigner comboBoxDesigner = new(); | ||
using ComboBox comboBox = new(); | ||
comboBoxDesigner.Initialize(comboBox); | ||
|
||
Action action = () => _ = comboBoxDesigner.SelectionRules; | ||
|
||
action.Should().ThrowExactly<NullReferenceException>(); | ||
} | ||
|
||
[Fact] | ||
public void ActionLists_WithDefaultComboBox_ShouldReturnExpectedCount() | ||
{ | ||
using ComboBoxDesigner comboBoxDesigner = new(); | ||
using ComboBox comboBox = new(); | ||
comboBoxDesigner.Initialize(comboBox); | ||
|
||
comboBoxDesigner.ActionLists.Count.Should().Be(1); | ||
} | ||
} |