Skip to content

Commit 28f7550

Browse files
committed
[Testing: Ergonomics] Simplifying testing state
- 테스트가 expectation를 좀 더 직접적으로 설명하도록 assert하는 방법을 단순화하도록 한다.
1 parent 03795d7 commit 28f7550

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

CounterTests/CounterTests.swift

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,14 @@ class CounterTests: XCTestCase {
2222
favoritePrimes: [3, 5],
2323
isNthPrimeButtonDisabled: false
2424
)
25+
26+
var expected = state
2527
let effects = counterViewReducer(&state, .counter(.incrTapped))
2628

29+
expected.count = 3
2730
XCTAssertEqual(
2831
state,
29-
CounterViewState(
30-
alertNthPrime: nil,
31-
count: 3,
32-
favoritePrimes: [3, 5],
33-
isNthPrimeButtonDisabled: false
34-
),
35-
"Expected count to increment to 3"
32+
expected
3633
)
3734
XCTAssertTrue(effects.isEmpty)
3835
}

0 commit comments

Comments
 (0)