Skip to content

Commit 1c8e9c2

Browse files
Add unit test for GridEntryRecreateChildrenEventArgs.cs file (#13497)
* Add unit test for GridEntryRecreateChildrenEventArgs.cs file
1 parent 8f21cd6 commit 1c8e9c2

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using System.Windows.Forms.PropertyGridInternal;
5+
6+
namespace System.Windows.Forms.Tests;
7+
8+
public class GridEntryRecreateChildrenEventArgsTests
9+
{
10+
[Theory]
11+
[InlineData(0, 0)]
12+
[InlineData(1, 2)]
13+
[InlineData(-1, 5)]
14+
[InlineData(10, -3)]
15+
[InlineData(int.MaxValue, int.MinValue)]
16+
[InlineData(int.MinValue, int.MaxValue)]
17+
public void GridEntryRecreateChildrenEventArgs_SetsProperties(int oldCount, int newCount)
18+
{
19+
GridEntryRecreateChildrenEventArgs args = new(oldCount, newCount);
20+
21+
args.OldChildCount.Should().Be(oldCount);
22+
args.NewChildCount.Should().Be(newCount);
23+
}
24+
25+
[Fact]
26+
public void GridEntryRecreateChildrenEventArgs_Inherits_EventArgs()
27+
{
28+
GridEntryRecreateChildrenEventArgs args = new(1, 2);
29+
30+
args.Should().BeAssignableTo<EventArgs>();
31+
}
32+
}

0 commit comments

Comments
 (0)