Skip to content

Commit 864cc81

Browse files
CopilotPureWeen
andcommitted
Add comprehensive tests for iOS DatePicker MinimumDate handling
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
1 parent 54430fd commit 864cc81

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/Core/tests/UnitTests/Views/DatePickerTests.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,20 @@ public void TestDatePickerMinValueHandling()
4444
// The DatePicker should have MinimumDate as its value due to coercion
4545
Assert.Equal(new DateTime(1900, 1, 1), datePicker.Date);
4646
}
47+
48+
[Fact]
49+
public void TestDatePickerWithCustomMinimumDate()
50+
{
51+
DatePicker datePicker = new DatePicker();
52+
53+
// Set a custom minimum date
54+
datePicker.MinimumDate = new DateTime(2020, 1, 1);
55+
56+
// Set date to MinValue - this should get coerced to the new MinimumDate
57+
datePicker.Date = DateTime.MinValue;
58+
59+
// The DatePicker should have the custom MinimumDate as its value
60+
Assert.Equal(new DateTime(2020, 1, 1), datePicker.Date);
61+
}
4762
}
4863
}

0 commit comments

Comments
 (0)