diff options
Diffstat (limited to 'android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PresetBankCapabilitiesTest.java')
-rw-r--r-- | android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PresetBankCapabilitiesTest.java | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PresetBankCapabilitiesTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PresetBankCapabilitiesTest.java index b614ce272..5556c8223 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PresetBankCapabilitiesTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PresetBankCapabilitiesTest.java @@ -12,53 +12,53 @@ import org.json.JSONObject; import java.util.Iterator; /** - * This is a unit test class for the SmartDeviceLink library project class : + * This is a unit test class for the SmartDeviceLink library project class : * {@link com.smartdevicelink.proxy.rpc.PresetBankCapabilities} */ public class PresetBankCapabilitiesTest extends TestCase { - - private PresetBankCapabilities msg; - @Override - public void setUp() { - msg = new PresetBankCapabilities(); - - msg.setOnScreenPresetsAvailable(TestValues.GENERAL_BOOLEAN); - } + private PresetBankCapabilities msg; + + @Override + public void setUp() { + msg = new PresetBankCapabilities(); + + msg.setOnScreenPresetsAvailable(TestValues.GENERAL_BOOLEAN); + } /** - * Tests the expected values of the RPC message. - */ - public void testRpcValues () { - // Test Values - boolean presets = msg.onScreenPresetsAvailable(); - - // Valid Tests - assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, presets); - - // Invalid/Null Tests - PresetBankCapabilities msg = new PresetBankCapabilities(); - assertNotNull(TestValues.NOT_NULL, msg); - - assertNull(TestValues.NULL, msg.onScreenPresetsAvailable()); - } - - public void testJson() { - JSONObject reference = new JSONObject(); - - try { - reference.put(PresetBankCapabilities.KEY_ON_SCREEN_PRESETS_AVAILABLE, TestValues.GENERAL_BOOLEAN); - - JSONObject underTest = msg.serializeJSON(); - assertEquals(TestValues.MATCH, reference.length(), underTest.length()); - - Iterator<?> iterator = reference.keys(); - while (iterator.hasNext()) { - String key = (String) iterator.next(); - assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); - } - } catch (JSONException e) { - fail(TestValues.JSON_FAIL); - } - } + * Tests the expected values of the RPC message. + */ + public void testRpcValues() { + // Test Values + boolean presets = msg.onScreenPresetsAvailable(); + + // Valid Tests + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, presets); + + // Invalid/Null Tests + PresetBankCapabilities msg = new PresetBankCapabilities(); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.onScreenPresetsAvailable()); + } + + public void testJson() { + JSONObject reference = new JSONObject(); + + try { + reference.put(PresetBankCapabilities.KEY_ON_SCREEN_PRESETS_AVAILABLE, TestValues.GENERAL_BOOLEAN); + + JSONObject underTest = msg.serializeJSON(); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); + + Iterator<?> iterator = reference.keys(); + while (iterator.hasNext()) { + String key = (String) iterator.next(); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + } + } catch (JSONException e) { + fail(TestValues.JSON_FAIL); + } + } }
\ No newline at end of file |