diff options
author | Joey Grover <joeygrover@gmail.com> | 2017-05-05 10:49:08 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-05 10:49:08 -0400 |
commit | 4bebb18889b1265c94353be0857e91911286e6de (patch) | |
tree | 1db013f8c854ecbb74ddd216cf63349cef0a0715 | |
parent | 964c5f34a6ef5dc777524cd8bdde5d26809e8335 (diff) | |
parent | 0b5de90f7394ceda8393002ca35b9a1c0ed4c941 (diff) | |
download | sdl_android-4bebb18889b1265c94353be0857e91911286e6de.tar.gz |
Merge pull request #484 from smartdevicelink/bugfix/utest_displayTypeTests
bugfix/utest_displayTypeTests
-rw-r--r-- | sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DisplayTypeTests.java | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DisplayTypeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DisplayTypeTests.java index 83af2561e..560bdf025 100644 --- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DisplayTypeTests.java +++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DisplayTypeTests.java @@ -9,15 +9,15 @@ import junit.framework.TestCase; import com.smartdevicelink.proxy.rpc.enums.DisplayType; /** - * This is a unit test class for the SmartDeviceLink library project class : - * {@link com.smartdevicelink.rpc.enums.DisplayType} + * This is a unit test class for the SmartDeviceLink library project class : + * {@link com.smartdevicelink.proxy.rpc.enums.DisplayType} */ public class DisplayTypeTests extends TestCase { /** * Verifies that the enum values are not null upon valid assignment. */ - public void testValidEnums () { + public void testValidEnums () { String example = "CID"; DisplayType enumCid = DisplayType.valueForString(example); example = "TYPE2"; @@ -38,6 +38,8 @@ public class DisplayTypeTests extends TestCase { DisplayType enumMfd5 = DisplayType.valueForString(example); example = "GEN3_8-INCH"; DisplayType enumGen3_8Inch = DisplayType.valueForString(example); + example = "SDL_GENERIC"; + DisplayType enumGeneric = DisplayType.valueForString(example); assertNotNull("CID returned null", enumCid); assertNotNull("TYPE2 returned null", enumType2); @@ -49,6 +51,7 @@ public class DisplayTypeTests extends TestCase { assertNotNull("MFD4 returned null", enumMfd4); assertNotNull("MFD5 returned null", enumMfd5); assertNotNull("GEN3_8-INCH returned null", enumGen3_8Inch); + assertNotNull("SDL_GENERIC returned null", enumGeneric); } /** @@ -57,11 +60,11 @@ public class DisplayTypeTests extends TestCase { public void testInvalidEnum () { String example = "cId"; try { - DisplayType temp = DisplayType.valueForString(example); - assertNull("Result of valueForString should be null.", temp); + DisplayType temp = DisplayType.valueForString(example); + assertNull("Result of valueForString should be null.", temp); } catch (IllegalArgumentException exception) { - fail("Invalid enum throws IllegalArgumentException."); + fail("Invalid enum throws IllegalArgumentException."); } } @@ -71,19 +74,19 @@ public class DisplayTypeTests extends TestCase { public void testNullEnum () { String example = null; try { - DisplayType temp = DisplayType.valueForString(example); - assertNull("Result of valueForString should be null.", temp); + DisplayType temp = DisplayType.valueForString(example); + assertNull("Result of valueForString should be null.", temp); } catch (NullPointerException exception) { - fail("Null string throws NullPointerException."); + fail("Null string throws NullPointerException."); } } - + /** * Verifies the possible enum values of DisplayType. */ public void testListEnum() { - List<DisplayType> enumValueList = Arrays.asList(DisplayType.values()); + List<DisplayType> enumValueList = Arrays.asList(DisplayType.values()); List<DisplayType> enumTestList = new ArrayList<DisplayType>(); enumTestList.add(DisplayType.CID); @@ -91,13 +94,14 @@ public class DisplayTypeTests extends TestCase { enumTestList.add(DisplayType.TYPE5); enumTestList.add(DisplayType.NGN); enumTestList.add(DisplayType.GEN2_8_DMA); - enumTestList.add(DisplayType.GEN2_6_DMA); + enumTestList.add(DisplayType.GEN2_6_DMA); enumTestList.add(DisplayType.MFD3); - enumTestList.add(DisplayType.MFD4); + enumTestList.add(DisplayType.MFD4); enumTestList.add(DisplayType.MFD5); - enumTestList.add(DisplayType.GEN3_8_INCH); + enumTestList.add(DisplayType.GEN3_8_INCH); + enumTestList.add(DisplayType.SDL_GENERIC); - assertTrue("Enum value list does not match enum class list", + assertTrue("Enum value list does not match enum class list", enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList)); - } + } }
\ No newline at end of file |