Re: [Seaside] Failing test for #fromJson:

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: [Seaside] Failing test for #fromJson:

John McKeon
I'm just guessing, but I bet if you change "Address" to "address" in the JSON string it just might work.
I'm also posting this to the Magritte list just in case...
 
Happy Trails
John

On Wed, Jun 20, 2012 at 8:23 AM, Tomas Kukol <[hidden email]> wrote:
Hello,

I have created a test for #fromJson: message.

MJTestFromJson >> testFromJsonWithAddress
      | person address |
      person := MJTestPerson fromJson:
'{"Name":"Tomas","Address":{"PostalCode":"19800","City":"Prague"}}'.

      self assert: person name equals:  'Tomas'.
      address := person address.
      self assert: address isNil not.
      self assert: address postalCode equals: '19800'.
      self assert: address city equals: 'Prague'.

But the test fails because it cannot find PostalCode in MJTestPerson
instace (should be probably in MJTestAddress). Is it a problem of my
#fromJson: usage or wrong implementation of JSON deserialization?

Thanks for any information.

Tomas Kukol
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki