diff --git a/PropertyTest.java b/PropertyTest.java index 4354488..60d3eb5 100644 --- a/PropertyTest.java +++ b/PropertyTest.java @@ -9,26 +9,35 @@ import org.junit.Test; /** - * Tests for JSON-Java Property.java + * Tests for JSON-Java Property */ public class PropertyTest { + /** + * JSONObject from null properties object should + * result in an empty JSONObject. + */ @Test public void shouldHandleNullProperties() { - Properties properties = null; JSONObject jsonObject = Property.toJSONObject(properties); assertTrue("jsonObject should be empty", jsonObject.length() == 0); } + /** + * JSONObject from empty properties object should + * result in an empty JSONObject. + */ @Test public void shouldHandleEmptyProperties() { - Properties properties = new Properties(); JSONObject jsonObject = Property.toJSONObject(properties); assertTrue("jsonObject should be empty", jsonObject.length() == 0); } + /** + * JSONObject from simple properties object. + */ @Test public void shouldHandleProperties() { Properties properties = new Properties(); @@ -54,6 +63,10 @@ public class PropertyTest { "Indianapolis".equals(jsonObject.get("Indiana"))); } + /** + * Null JSONObject toProperties() should result in an empty + * Properties object. + */ @Test public void shouldHandleNullJSONProperty() { JSONObject jsonObject= null; @@ -62,6 +75,10 @@ public class PropertyTest { properties.size() == 0); } + /** + * Properties should convert to JSONObject, and back to + * Properties without changing. + */ @Test public void shouldHandleJSONProperty() { Properties properties = new Properties();