forked from loafle/openapi-generator-original
[swift5][client] - enable swift unit tests (#14441)
This commit is contained in:
parent
a584f32d68
commit
b1f8f976c0
@ -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]}
|
||||||
|
@ -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 })
|
||||||
|
@ -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]}
|
||||||
|
@ -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 })
|
||||||
|
@ -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]}
|
||||||
|
@ -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]}
|
||||||
|
@ -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]}
|
||||||
|
@ -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 })
|
||||||
|
@ -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]}
|
||||||
|
@ -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]}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user