     }
 
     func testJsonDecode() {
-        let jsonString = "{\"int\":321.0,\"bool\":false," +
-        "\"array\":[\"bar\"],\"dict\":{\"bar\":\"baz\"}," +
-        "\"float\":321.0,\"string\":\"bar\",\"sub\":{\"foo\":\"bar\"}}"
+        let jsonString = "{\"int\":321.0,\"bool\":false,\"date\":0," +
+                         "\"array\":[\"bar\"],\"dict\":{\"bar\":\"baz\"}," +
+                         "\"float\":321.0,\"string\":\"bar\",\"sub\":{\"foo\":\"bar\"}}"
 
-        let decoder = JsonDecoder(jsonString: jsonString)
-        let decoded = TestStruct(json: decoder.json)
+        let json = Json.jsonWithJsonString(jsonString)
+        let decoded = TestStruct(json: json)
 
         XCTAssert(decoded.int == 321, "Invalid int value")
         XCTAssert(decoded.bool == false, "Invalid bool value")

        XCTAssert(decoded.float == 321.0, "Invalid float value")
        XCTAssert(decoded.string == "bar", "Invalid string value")
        XCTAssert(decoded.sub.foo == "bar", "Invalid sub value")
    }
}


    func testJsonEncode() {
        let testObject = TestStruct()
        let expected = "{\"int\":123.0,\"bool\":true,\"null\":null,\"date\":0.0," +
                       "\"array\":[\"foo\"],\"dict\":{\"foo\":\"bar\"}," +
                       "\"float\":123.0,\"string\":\"foo\",\"sub\":{\"foo\":\"bar\"}}"
        let encoded = testObject.toJson().toString()
        XCTAssert(encoded == expected, "Invalid JSON: \(encoded)")
    }
