Skip to content

Commit f77654d

Browse files
committed
Fixed Stepper handler broken tests
1 parent b003b73 commit f77654d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/Core/src/Platform/iOS/StepperExtensions.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ public static void UpdateMaximum(this UIStepper nativeStepper, IStepper stepper)
1616

1717
public static void UpdateIncrement(this UIStepper nativeStepper, IStepper stepper)
1818
{
19-
nativeStepper.StepValue = stepper.Increment;
19+
var increment = stepper.Increment;
20+
21+
if (increment > 0)
22+
nativeStepper.StepValue = stepper.Increment;
2023
}
2124

2225
public static void UpdateValue(this UIStepper nativeStepper, IStepper stepper)

src/Core/tests/DeviceTests/Handlers/Stepper/StepperHandlerTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public async Task MaximumInitializesCorrectly()
3030
{
3131
var stepper = new StepperStub()
3232
{
33+
Minimum = 0,
3334
Maximum = 50
3435
};
3536

@@ -41,7 +42,8 @@ public async Task MinimumInitializesCorrectly()
4142
{
4243
var stepper = new StepperStub()
4344
{
44-
Minimum = 10
45+
Minimum = 10,
46+
Maximum = 50
4547
};
4648

4749
await ValidatePropertyInitValue(stepper, () => stepper.Minimum, GetNativeMinimum, stepper.Minimum);

0 commit comments

Comments
 (0)