Content-Length: 2547 | pFad | http://github.com/dotnet/winforms/pull/13511.patch

thub.com From 20655b6efd42dde93502d9f25a62d4767fee21dc Mon Sep 17 00:00:00 2001 From: "Zheng Li (BEYONDSOFT CONSULTING INC)" Date: Fri, 23 May 2025 10:15:25 +0800 Subject: [PATCH] Add code coverage for ImageListConverter & RelatedImageListAttribute --- .../Windows/Forms/ImageListConverterTests.cs | 23 +++++++++++++++++++ .../Forms/RelatedImageListAttributeTests.cs | 17 ++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 src/test/unit/System.Windows.Forms/System/Windows/Forms/ImageListConverterTests.cs create mode 100644 src/test/unit/System.Windows.Forms/System/Windows/Forms/RelatedImageListAttributeTests.cs diff --git a/src/test/unit/System.Windows.Forms/System/Windows/Forms/ImageListConverterTests.cs b/src/test/unit/System.Windows.Forms/System/Windows/Forms/ImageListConverterTests.cs new file mode 100644 index 00000000000..f25fc92700b --- /dev/null +++ b/src/test/unit/System.Windows.Forms/System/Windows/Forms/ImageListConverterTests.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.ComponentModel; + +namespace System.Windows.Forms.Controls.Tests; + +public class ImageListConverterTests +{ + internal ImageListConverter Converter { get; } = new(); + + [Fact] + public void Ctor_Default_SetsBaseType() + { + Converter.Should().BeAssignableTo(); + } + + [Fact] + public void GetPropertiesSupported_ReturnsTrue() + { + Converter.GetPropertiesSupported(null).Should().BeTrue(); + } +} diff --git a/src/test/unit/System.Windows.Forms/System/Windows/Forms/RelatedImageListAttributeTests.cs b/src/test/unit/System.Windows.Forms/System/Windows/Forms/RelatedImageListAttributeTests.cs new file mode 100644 index 00000000000..58046102701 --- /dev/null +++ b/src/test/unit/System.Windows.Forms/System/Windows/Forms/RelatedImageListAttributeTests.cs @@ -0,0 +1,17 @@ +// 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.Controls.Tests; + +public class RelatedImageListAttributeTests +{ + [Theory] + [InlineData(null)] + [InlineData("")] + [InlineData("MainImageList")] + public void RelatedImageList_ReturnsConstructorValue(string? value) + { + RelatedImageListAttribute attr = new(value); + attr.RelatedImageList.Should().Be(value); + } +}








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/dotnet/winforms/pull/13511.patch

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy