[swift5][client] - enable swift unit tests (#14441)

This commit is contained in:
Bruno Coelho 2023-01-12 15:10:15 +00:00 committed by GitHub
parent a584f32d68
commit b1f8f976c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 13 additions and 10 deletions

View File

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]}

View File

@ -46,7 +46,8 @@ class APIHelperTests: XCTestCase {
func testMapValuesToQueryItems() { func testMapValuesToQueryItems() {
let source: [String: Any] = ["a": 1, "c": ["1", nil, "2"], "d": true, "e": false] let source: [String: Any] = ["a": 1, "c": ["1", nil, "2"], "d": true, "e": false]
let expected: [URLQueryItem] = [URLQueryItem(name: "a", value: "1"), let expected: [URLQueryItem] = [URLQueryItem(name: "a", value: "1"),
URLQueryItem(name: "c", value: "1,2"), URLQueryItem(name: "c", value: "1"),
URLQueryItem(name: "c", value: "2"),
URLQueryItem(name: "d", value: "true"), URLQueryItem(name: "d", value: "true"),
URLQueryItem(name: "e", value: "false")].sorted(by: { $0.name > $1.name }) URLQueryItem(name: "e", value: "false")].sorted(by: { $0.name > $1.name })
let actual: [URLQueryItem] = APIHelper.mapValuesToQueryItems(source)!.sorted(by: { $0.name > $1.name }) let actual: [URLQueryItem] = APIHelper.mapValuesToQueryItems(source)!.sorted(by: { $0.name > $1.name })

View File

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]}

View File

@ -46,7 +46,8 @@ class APIHelperTests: XCTestCase {
func testMapValuesToQueryItems() { func testMapValuesToQueryItems() {
let source: [String: Any] = ["a": 1, "c": ["1", nil, "2"], "d": true, "e": false] let source: [String: Any] = ["a": 1, "c": ["1", nil, "2"], "d": true, "e": false]
let expected: [URLQueryItem] = [URLQueryItem(name: "a", value: "1"), let expected: [URLQueryItem] = [URLQueryItem(name: "a", value: "1"),
URLQueryItem(name: "c", value: "1,2"), URLQueryItem(name: "c", value: "1"),
URLQueryItem(name: "c", value: "2"),
URLQueryItem(name: "d", value: "true"), URLQueryItem(name: "d", value: "true"),
URLQueryItem(name: "e", value: "false")].sorted(by: { $0.name > $1.name }) URLQueryItem(name: "e", value: "false")].sorted(by: { $0.name > $1.name })
let actual: [URLQueryItem] = APIHelper.mapValuesToQueryItems(source)!.sorted(by: { $0.name > $1.name }) let actual: [URLQueryItem] = APIHelper.mapValuesToQueryItems(source)!.sorted(by: { $0.name > $1.name })

View File

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]}

View File

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]}

View File

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]}

View File

@ -46,7 +46,8 @@ class APIHelperTests: XCTestCase {
func testMapValuesToQueryItems() { func testMapValuesToQueryItems() {
let source: [String: Any] = ["a": 1, "c": ["1", nil, "2"], "d": true, "e": false] let source: [String: Any] = ["a": 1, "c": ["1", nil, "2"], "d": true, "e": false]
let expected: [URLQueryItem] = [URLQueryItem(name: "a", value: "1"), let expected: [URLQueryItem] = [URLQueryItem(name: "a", value: "1"),
URLQueryItem(name: "c", value: "1,2"), URLQueryItem(name: "c", value: "1"),
URLQueryItem(name: "c", value: "2"),
URLQueryItem(name: "d", value: "true"), URLQueryItem(name: "d", value: "true"),
URLQueryItem(name: "e", value: "false")].sorted(by: { $0.name > $1.name }) URLQueryItem(name: "e", value: "false")].sorted(by: { $0.name > $1.name })
let actual: [URLQueryItem] = APIHelper.mapValuesToQueryItems(source)!.sorted(by: { $0.name > $1.name }) let actual: [URLQueryItem] = APIHelper.mapValuesToQueryItems(source)!.sorted(by: { $0.name > $1.name })

View File

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]}

View File

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcpretty && exit ${PIPESTATUS[0]}