File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -15,21 +15,30 @@ class ObservableTests: XCTestCase {
1515
1616 override func setUpWithError( ) throws {
1717 observable = Observable ( value: 0 )
18- observable. bind { [ unowned self] number in
19- newValue = number
20- }
2118 }
2219
2320 override func tearDownWithError( ) throws {
2421 observable = nil
2522 newValue = nil
2623 }
2724
28- func testChangingValue ( ) throws {
25+ func testChangingValueWithBinding ( ) throws {
2926 let newNumber = 1
27+ observable. bind { [ unowned self] number in
28+ newValue = number
29+ }
3030
3131 observable. value = newNumber
3232
3333 XCTAssertEqual ( newValue, newNumber)
3434 }
35+
36+ func testChangingValueWithoutBinding( ) throws {
37+ let newNumber = 1
38+
39+ observable. value = newNumber
40+
41+ XCTAssertNil ( newValue)
42+ XCTAssertNotEqual ( newValue, newNumber)
43+ }
3544}
You can’t perform that action at this time.
0 commit comments