From 81ee8428e1c0b612c3e6804a011812e0bf72e605 Mon Sep 17 00:00:00 2001 From: "Zheng Li (Beyondsoft Corporation)" Date: Mon, 23 Dec 2024 15:34:00 +0800 Subject: [PATCH 1/2] Add code coverage for DataGridViewRowHeightInfoPushedEventArgs --- ...idViewRowHeightInfoPushedEventArgsTests.cs | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/DataGridViewRowHeightInfoPushedEventArgsTests.cs diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/DataGridViewRowHeightInfoPushedEventArgsTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/DataGridViewRowHeightInfoPushedEventArgsTests.cs new file mode 100644 index 00000000000..3b7bd4bedbb --- /dev/null +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/DataGridViewRowHeightInfoPushedEventArgsTests.cs @@ -0,0 +1,25 @@ +// 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.Tests; + +public class DataGridViewRowHeightInfoPushedEventArgsTests +{ + [WinFormsTheory] + [InlineData(1, 20, 10)] + [InlineData(0, 20, 10)] + [InlineData(1, 0, 10)] + [InlineData(1, 20, 0)] + [InlineData(-1, 20, 10)] + [InlineData(1, 20, 5)] + public void Ctor_ValidArguments_SetsProperties(int rowIndex, int height, int minimumHeight) + { + DataGridViewRowHeightInfoPushedEventArgs e = new(rowIndex, height, minimumHeight); + + e.RowIndex.Should().Be(rowIndex); + e.Height.Should().Be(height); + e.MinimumHeight.Should().Be(minimumHeight); + } +} From a8a91dfdff05b359ed18a4e1ddc2e391cec2cd6f Mon Sep 17 00:00:00 2001 From: v-zhgl <38325459+Zheng-Li01@users.noreply.github.com> Date: Wed, 8 Jan 2025 15:09:56 +0800 Subject: [PATCH 2/2] Update src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/DataGridViewRowHeightInfoPushedEventArgsTests.cs Co-authored-by: Tanya Solyanik --- .../Forms/DataGridViewRowHeightInfoPushedEventArgsTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/DataGridViewRowHeightInfoPushedEventArgsTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/DataGridViewRowHeightInfoPushedEventArgsTests.cs index 3b7bd4bedbb..278eb532cfb 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/DataGridViewRowHeightInfoPushedEventArgsTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/DataGridViewRowHeightInfoPushedEventArgsTests.cs @@ -7,7 +7,7 @@ namespace System.Windows.Forms.Tests; public class DataGridViewRowHeightInfoPushedEventArgsTests { - [WinFormsTheory] + [Theory] [InlineData(1, 20, 10)] [InlineData(0, 20, 10)] [InlineData(1, 0, 10)]