Skip to content

Commit d15498f

Browse files
committed
Add test for initialStateName check
1 parent 75d1e1e commit d15498f

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/SoftButtonManagerTests.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,18 @@ public void testConstructSoftButtonObjectWithNonEmptyStateList() {
426426
assertEquals(stateList, softButtonObject.getStates());
427427
}
428428

429+
/**
430+
* Test constructing SoftButtonObject with an invalid initialStateName
431+
*/
432+
@Test
433+
public void testConstructSoftButtonObjectWithInvalidInitialStateName() {
434+
List<SoftButtonState> stateList = new ArrayList<>();
435+
SoftButtonState softButtonState = new SoftButtonState("general_kenobi", "General Kenobi", null);
436+
stateList.add(softButtonState);
437+
SoftButtonObject softButtonObject = new SoftButtonObject("hello_there", stateList, "hello_there", null);
438+
assertNull(softButtonObject.getStates());
439+
}
440+
429441
/**
430442
* Test assigning an empty state list to existing SoftButtonObject
431443
*/

0 commit comments

Comments
 (0)