Skip to content

Commit

Permalink
Add code coverage for DataGridViewRowHeightInfoPushedEventArgs (#12673)
Browse files Browse the repository at this point in the history
related #10453

Proposed changes
Add unit tests for DataGridViewRowHeightInfoPushedEventArgs.cs to test its properties
  • Loading branch information
Zheng-Li01 authored Jan 8, 2025
1 parent cd5dd1c commit 7c956a3
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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
{
[Theory]
[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);
}
}

0 comments on commit 7c956a3

Please sign in to comment.