in source/UberRidesTests/ObjectMappingTests.swift [365:383]
func testPostRequest() {
let bundle = Bundle(for: ObjectMappingTests.self)
if let path = bundle.path(forResource: "postRequests", ofType: "json") {
if let jsonData = try? Data(contentsOf: URL(fileURLWithPath: path)) {
guard let trip = try? JSONDecoder.uberDecoder.decode(Ride.self, from: jsonData) else {
XCTAssert(false)
return
}
XCTAssertNotNil(trip)
XCTAssertEqual(trip.requestID, "852b8fdd-4369-4659-9628-e122662ad257")
XCTAssertEqual(trip.status, RideStatus.processing)
XCTAssertNil(trip.vehicle)
XCTAssertNil(trip.driver)
XCTAssertNil(trip.driverLocation)
XCTAssertEqual(trip.surgeMultiplier, 1.0)
}
}
}