Skip to content

Commit ada64f7

Browse files
SimonZhao888Simon Zhao (BEYONDSOFT CONSULTING INC)
and
Simon Zhao (BEYONDSOFT CONSULTING INC)
authored
Add test case for MonthCalendarDesigner (#11692)
* Add test case for MonthCalendarDesigner * Add enable nullability --------- Co-authored-by: Simon Zhao (BEYONDSOFT CONSULTING INC) <[email protected]>
1 parent 72c79eb commit ada64f7

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
#nullable enable
5+
6+
namespace System.Windows.Forms.Design.Tests;
7+
8+
public sealed class MonthCalendarDesignerTests
9+
{
10+
[Fact]
11+
public void AutoResizeHandles_WithDefaultMonthCalendar_ShouldBeTrue()
12+
{
13+
using MonthCalendarDesigner monthCalendarDesigner = new();
14+
using MonthCalendar monthCalendar = new();
15+
monthCalendarDesigner.Initialize(monthCalendar);
16+
17+
monthCalendarDesigner.AutoResizeHandles.Should().BeTrue();
18+
}
19+
20+
[Fact]
21+
public void SelectionRules_WithDefaultMonthCalendar_ShouldReturnExpectedValue()
22+
{
23+
using MonthCalendarDesigner monthCalendarDesigner = new();
24+
using MonthCalendar monthCalendar = new();
25+
monthCalendarDesigner.Initialize(monthCalendar);
26+
27+
SelectionRules selectionRules;
28+
using (new NoAssertContext())
29+
{
30+
selectionRules = monthCalendarDesigner.SelectionRules;
31+
}
32+
33+
selectionRules.Should().Be(SelectionRules.BottomSizeable | SelectionRules.RightSizeable | SelectionRules.Moveable | SelectionRules.Visible);
34+
}
35+
}

0 commit comments

Comments
 (0)