Skip to content

Commit b959e79

Browse files
svdokzaher
authored andcommitted
Added unit test for UIStepper stepValue reactive wrapper
1 parent 1743fa6 commit b959e79

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Tests/RxCocoaTests/UIStepper+RxTests.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ import XCTest
2222
let createView: () -> UIStepper = { UIStepper(frame: CGRect(x: 0, y: 0, width: 1, height: 1)) }
2323
ensurePropertyDeallocated(createView, 1) { (view: UIStepper) in view.rx.value }
2424
}
25+
26+
func testStepper_stepValueObserver() {
27+
let stepper = UIStepper()
28+
let stepValue: Double = 0.42
29+
Observable.just(stepValue).bind(to: stepper.rx.stepValue).dispose()
30+
XCTAssertEqual(stepper.stepValue, stepValue, accuracy: 0.0001)
31+
}
2532
}
2633

2734
#endif

0 commit comments

Comments
 (0)