func testCreateQueryParameters_withoutNicknames()

in source/UberRidesTests/RequestURLUtilTests.swift [111:152]


    func testCreateQueryParameters_withoutNicknames() {
        
        let testPickupLocation = CLLocation(latitude: 32.0, longitude: -32.0)
        let testDropoffLocation = CLLocation(latitude: 62.0, longitude: -62.0)
        let testPickupAddress = "123 pickup address"
        let testDropoffAddress = "123 dropoff address"
        let testProductID = "test ID"
        let testSource = "test source"
        let expectedUserAgent = "\(baseUserAgent!)-\(testSource)"
        
        let pickupLatitudeQueryItem = URLQueryItem(name: "pickup[latitude]", value: "\(testPickupLocation.coordinate.latitude)")
        let pickupLongitudeQueryItem = URLQueryItem(name: "pickup[longitude]", value: "\(testPickupLocation.coordinate.longitude)")
        let pickupAddressQueryItem = URLQueryItem(name: "pickup[formatted_address]", value: testPickupAddress)
        
        let dropoffLatitudeQueryItem = URLQueryItem(name: "dropoff[latitude]", value: "\(testDropoffLocation.coordinate.latitude)")
        let dropoffLongitudeQueryItem = URLQueryItem(name: "dropoff[longitude]", value: "\(testDropoffLocation.coordinate.longitude)")
        let dropoffAddressQueryItem = URLQueryItem(name: "dropoff[formatted_address]", value: testDropoffAddress)
        
        let productIdQueryItem = URLQueryItem(name: "product_id", value: testProductID)
        let clientIdQueryItem = URLQueryItem(name: "client_id", value: "testClientID")
        let userAgentQueryItem = URLQueryItem(name: "user-agent", value: expectedUserAgent)
        let actionQueryItem = URLQueryItem(name: "action", value: "setPickup")
        
        let expectedQueryParameters = [pickupLatitudeQueryItem, pickupLongitudeQueryItem, pickupAddressQueryItem,
                                       dropoffLatitudeQueryItem, dropoffLongitudeQueryItem, dropoffAddressQueryItem,
                                       productIdQueryItem, clientIdQueryItem, userAgentQueryItem, actionQueryItem]

        let parameters = RideParametersBuilder()
        parameters.pickupLocation = testPickupLocation
        parameters.dropoffLocation = testDropoffLocation
        parameters.pickupAddress = testPickupAddress
        parameters.dropoffAddress = testDropoffAddress
        parameters.productID = testProductID
        parameters.source = testSource
        
        let comparisonSet = NSSet(array: expectedQueryParameters)
        
        let testQueryParameters = RequestURLUtil.buildRequestQueryParameters(parameters.build())
        let testComparisonSet = NSSet(array:testQueryParameters)
        
        XCTAssertEqual(comparisonSet, testComparisonSet)
    }