Skip to content

Commit

Permalink
Merge pull request #40 from smartystreets/landon/new-intl-fields
Browse files Browse the repository at this point in the history
Add new intl fields
  • Loading branch information
RyanLCox1 authored Oct 16, 2024
2 parents 78c1616 + e9b6945 commit 2203d7d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ import Foundation
public var postBox:String?
public var postBoxType:String?
public var postBoxNumber:String?
public var additionalContent:String?
public var deliveryInstallation:String?
public var deliveryInstallationType:String?
public var deliveryInstallationQualifierName:String?
public var route:String?
public var routeNumber:String?
public var routeType:String?

enum CodingKeys: String, CodingKey {
case countryIso3 = "country_iso_3"
Expand Down Expand Up @@ -91,6 +98,13 @@ import Foundation
case postBox = "post_box"
case postBoxType = "post_box_type"
case postBoxNumber = "post_box_number"
case additionalContent = "additional_content"
case deliveryInstallation = "delivery_installation"
case deliveryInstallationType = "delivery_installation_type"
case deliveryInstallationQualifierName = "delivery_installation_qualifier_name"
case route = "route"
case routeNumber = "route_number"
case routeType = "route_type"
}

init(dictionary:NSDictionary) {
Expand Down Expand Up @@ -137,5 +151,12 @@ import Foundation
self.postBox = dictionary["post_box"] as? String
self.postBoxType = dictionary["post_box_type"] as? String
self.postBoxNumber = dictionary["post_box_number"] as? String
self.additionalContent = dictionary["additional_content"] as? String
self.deliveryInstallation = dictionary["delivery_installation"] as? String
self.deliveryInstallationType = dictionary["delivery_installation_type"] as? String
self.deliveryInstallationQualifierName = dictionary["delivery_installation_qualifier_name"] as? String
self.route = dictionary["route"] as? String
self.routeNumber = dictionary["route_number"] as? String
self.routeType = dictionary["route_type"] as? String
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,14 @@ class InternationalCandidateTests: XCTestCase {
"level_number": "48.2",
"post_box": "49",
"post_box_type": "50",
"post_box_number": "51"
"post_box_number": "51",
"additional_content": "112",
"delivery_installation": "113",
"delivery_installation_type": "114",
"delivery_installation_qualifier_name": "115",
"route": "116",
"route_number": "117",
"route_type": "118",
],
"metadata": [
"latitude": 52.0,
Expand Down Expand Up @@ -207,6 +214,13 @@ class InternationalCandidateTests: XCTestCase {
XCTAssertEqual("49", components.postBox)
XCTAssertEqual("50", components.postBoxType)
XCTAssertEqual("51", components.postBoxNumber)
XCTAssertEqual("112", components.additionalContent)
XCTAssertEqual("113", components.deliveryInstallation)
XCTAssertEqual("114", components.deliveryInstallationType)
XCTAssertEqual("115", components.deliveryInstallationQualifierName)
XCTAssertEqual("116", components.route)
XCTAssertEqual("117", components.routeNumber)
XCTAssertEqual("118", components.routeType)

let metadata = candidate.metadata!
XCTAssertNotNil(metadata)
Expand Down

0 comments on commit 2203d7d

Please sign in to comment.