1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 07:50:52 -07:00

fixes test to not depend on key order

This commit is contained in:
John J. Aylward 2016-08-17 12:13:54 -04:00
parent a66b97f60b
commit 0b1dbe9369

View file

@ -202,10 +202,9 @@ public class JSONObjectTest {
// verify Fraction output
jsonObject = new JSONObject(Collections.singletonMap("myNumber", new Fraction(4,2)));
actual = jsonObject.toString();
expected = "{\"myNumber\":{\"denominator\":2,\"numerator\":4}}";
assertEquals("Not Equal", expected , actual);
assertEquals("Numerator", BigInteger.valueOf(4) , jsonObject.query("/myNumber/numerator"));
assertEquals("Denominator", BigInteger.valueOf(2) , jsonObject.query("/myNumber/denominator"));
jsonObject = new JSONObject();
jsonObject.put("myNumber", new Fraction(4,2));
actual = jsonObject.toString();