-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathEncodeNestingTests.swift
More file actions
33 lines (29 loc) · 875 Bytes
/
EncodeNestingTests.swift
File metadata and controls
33 lines (29 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// EncodeNestingTests.swift
// JSONCodable
//
// Created by Richard Fox on 6/19/16.
//
//
import XCTest
import JSONCodable
class EncodeNestingTests: XCTestCase {
let propertyItemArray: JSONObject = [
"class": "propertyType",
"rel": "propertyType",
"properties":
[ "name": "person",
"location": [ "coord": [
"lat": 37.790770,
"long": -122.402015
]]]]
func testEncodeNestedPropertyItem() {
guard let pItem = try? PropertyItem(object: propertyItemArray),
let json = try? pItem.toJSON(),
let json1 = json as? JSONObject else {
XCTFail()
return
}
XCTAssert(String(describing:json1) == String(describing:propertyItemArray), "failed to convert to \(propertyItemArray)")
}
}