diff options
Diffstat (limited to 'android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageCushionFirmnessTest.java')
-rw-r--r-- | android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageCushionFirmnessTest.java | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageCushionFirmnessTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageCushionFirmnessTest.java index fb3e9a764..f4485698b 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageCushionFirmnessTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageCushionFirmnessTest.java @@ -18,54 +18,54 @@ import java.util.Iterator; */ public class MassageCushionFirmnessTest extends TestCase { - private MassageCushionFirmness msg; - - @Override - public void setUp() { - msg = new MassageCushionFirmness(); - - msg.setCushion(TestValues.GENERAL_MASSAGECUSHION); - msg.setFirmness(TestValues.GENERAL_INT); - } - - /** - * Tests the expected values of the RPC message. - */ - public void testRpcValues() { - // Test Values - MassageCushion cushion = msg.getCushion(); - Integer firmness = msg.getFirmness(); - - // Valid Tests - assertEquals(TestValues.MATCH, TestValues.GENERAL_MASSAGECUSHION, cushion); - assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, firmness); - - // Invalid/Null Tests - MassageCushionFirmness msg = new MassageCushionFirmness(); - assertNotNull(TestValues.NOT_NULL, msg); - - assertNull(TestValues.NULL, msg.getCushion()); - assertNull(TestValues.NULL, msg.getFirmness()); - } - - public void testJson() { - JSONObject reference = new JSONObject(); - - try { - reference.put(MassageCushionFirmness.KEY_CUSHION, TestValues.GENERAL_MASSAGECUSHION); - reference.put(MassageCushionFirmness.KEY_FIRMNESS, TestValues.GENERAL_INT); - - 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); - } - } + private MassageCushionFirmness msg; + + @Override + public void setUp() { + msg = new MassageCushionFirmness(); + + msg.setCushion(TestValues.GENERAL_MASSAGECUSHION); + msg.setFirmness(TestValues.GENERAL_INT); + } + + /** + * Tests the expected values of the RPC message. + */ + public void testRpcValues() { + // Test Values + MassageCushion cushion = msg.getCushion(); + Integer firmness = msg.getFirmness(); + + // Valid Tests + assertEquals(TestValues.MATCH, TestValues.GENERAL_MASSAGECUSHION, cushion); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, firmness); + + // Invalid/Null Tests + MassageCushionFirmness msg = new MassageCushionFirmness(); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getCushion()); + assertNull(TestValues.NULL, msg.getFirmness()); + } + + public void testJson() { + JSONObject reference = new JSONObject(); + + try { + reference.put(MassageCushionFirmness.KEY_CUSHION, TestValues.GENERAL_MASSAGECUSHION); + reference.put(MassageCushionFirmness.KEY_FIRMNESS, TestValues.GENERAL_INT); + + 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 |