diff --git a/src/System.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/ComboBoxDesignerTests.cs b/src/System.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/ComboBoxDesignerTests.cs new file mode 100644 index 00000000000..133df57fee1 --- /dev/null +++ b/src/System.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/ComboBoxDesignerTests.cs @@ -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(); + } + + [Fact] + public void ActionLists_WithDefaultComboBox_ShouldReturnExpectedCount() + { + using ComboBoxDesigner comboBoxDesigner = new(); + using ComboBox comboBox = new(); + comboBoxDesigner.Initialize(comboBox); + + comboBoxDesigner.ActionLists.Count.Should().Be(1); + } +}