Skip to content
This repository has been archived by the owner on Jun 16, 2019. It is now read-only.

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Aidan Follestad committed Feb 23, 2017
1 parent 01ae2ce commit f721355
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/test/java/com/afollestad/ason/AsonSerializeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ public Person() {
assertEquals(21, first.get("age"));
}

@Test public void test_primitive_serialize() {
int[] ids = new int[]{1, 2, 3, 4};
AsonArray<Integer> array = Ason.serializeArray(ids);
assertEquals("[1,2,3,4]", array.toString());
}

//
////// DESERIALIZE
//
Expand Down Expand Up @@ -190,4 +196,14 @@ public Person() {
assertEquals(person.id, 1);
assertEquals(person.age, 21);
}

@Test public void test_primitive_deserialize() {
AsonArray<Integer> array = new AsonArray<Integer>()
.add(1, 2, 3, 4);
int[] primitive = Ason.deserialize(array, int[].class);
assertEquals(1, primitive[0]);
assertEquals(2, primitive[1]);
assertEquals(3, primitive[2]);
assertEquals(4, primitive[3]);
}
}

0 comments on commit f721355

Please sign in to comment.