From 363f9cf315706b9058ddd1881e84e187938cde48 Mon Sep 17 00:00:00 2001 From: Epica3055 <135201996+Epica3055@users.noreply.github.com> Date: Fri, 2 Aug 2024 04:14:30 +0800 Subject: [PATCH] Add test case for NotifyIconDesigner (#11774) --- .../Forms/Design/NotifyIconDesignerTests.cs | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/System.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/NotifyIconDesignerTests.cs diff --git a/src/System.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/NotifyIconDesignerTests.cs b/src/System.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/NotifyIconDesignerTests.cs new file mode 100644 index 00000000000..03cbdda4d6a --- /dev/null +++ b/src/System.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/NotifyIconDesignerTests.cs @@ -0,0 +1,29 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#nullable enable + +namespace System.Windows.Forms.Design.Tests; + +public sealed class NotifyIconDesignerTests +{ + [Fact] + public void Visible_WithDefaultNotifyIcon_ShouldBeTrue() + { + using NotifyIconDesigner notifyIconDesigner = new(); + using NotifyIcon icon = new(); + notifyIconDesigner.Initialize(icon); + notifyIconDesigner.InitializeNewComponent(null); + + icon.Visible.Should().BeTrue(); + } + + [Fact] + public void ActionLists_WithDefaultNotifyIcon_ShouldReturnExpectedValue() + { + using NotifyIconDesigner notifyIconDesigner = new(); + using NotifyIcon icon = new(); + notifyIconDesigner.Initialize(icon); + notifyIconDesigner.ActionLists.Count.Should().Be(1); + } +}