Skip to content

Commit c724475

Browse files
author
Andrew(유금상)
committed
how to test string array
1 parent 4f42966 commit c724475

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Example/RxValidatorExample/RxValidatorExampleTests/StringValidateTests.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,13 @@ class StringValidateTests: XCTestCase {
113113
}
114114

115115

116+
func testStringArray() {
117+
let targetValue = ["1", "2", "3"]
118+
119+
let result: RxValidatorResult = targetValue
120+
.compactMap { return Validate.to($0).validate(StringShouldNotBeEmpty()).check() }
121+
.reduce(RxValidatorResult.valid) { $0 != .valid ? $0 : $1 }
122+
123+
expect(result).toEventually(equal(.valid))
124+
}
116125
}

0 commit comments

Comments
 (0)