diff options
author | Noah Stanford <noah@livio.io> | 2022-01-20 17:09:39 -0500 |
---|---|---|
committer | Noah Stanford <noah@livio.io> | 2022-01-20 17:09:39 -0500 |
commit | e183f3541ac7e78b59aee6e5ce969f5481dd73f8 (patch) | |
tree | 42fc9736c74e27eb9c5b5544d9e00f1c18ae4af1 | |
parent | 528769f4bdfca7a937d435d7fe22ad4761d9d261 (diff) | |
download | sdl_android-e183f3541ac7e78b59aee6e5ce969f5481dd73f8.tar.gz |
Update ScreenManagerTests test
Update ScreenManagerTests.testAssigningIdsToSoftButtonObjects())
-rw-r--r-- | android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java index b5cecf26c..05f390d16 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java @@ -217,14 +217,15 @@ public class ScreenManagerTests { } @Test public void testAssigningIdsToSoftButtonObjects() { + SoftButtonState defaultState = new SoftButtonState("default", "hi", null); SoftButtonObject sbo1, sbo2, sbo3, sbo4, sbo5; // Case 1 - don't set id for any button (Manager should set ids automatically starting from 1 and up) - sbo1 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null); - sbo2 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null); - sbo3 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null); - sbo4 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null); - sbo5 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null); + sbo1 = new SoftButtonObject(null, defaultState, null); + sbo2 = new SoftButtonObject(null, defaultState, null); + sbo3 = new SoftButtonObject(null, defaultState, null); + sbo4 = new SoftButtonObject(null, defaultState, null); + sbo5 = new SoftButtonObject(null, defaultState, null); screenManager.checkAndAssignButtonIds(Arrays.asList(sbo1, sbo2, sbo3, sbo4, sbo5), BaseScreenManager.ManagerLocation.SOFTBUTTON_MANAGER); assertEquals("SoftButtonObject id doesn't match the expected value", 1, sbo1.getButtonId()); assertEquals("SoftButtonObject id doesn't match the expected value", 2, sbo2.getButtonId()); @@ -234,15 +235,15 @@ public class ScreenManagerTests { // Case 2 - Set ids for all buttons (Manager shouldn't alter the ids set by developer) - sbo1 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null); + sbo1 = new SoftButtonObject(null, defaultState, null); sbo1.setButtonId(100); - sbo2 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null); + sbo2 = new SoftButtonObject(null, defaultState, null); sbo2.setButtonId(200); - sbo3 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null); + sbo3 = new SoftButtonObject(null, defaultState, null); sbo3.setButtonId(300); - sbo4 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null); + sbo4 = new SoftButtonObject(null, defaultState, null); sbo4.setButtonId(400); - sbo5 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null); + sbo5 = new SoftButtonObject(null, defaultState, null); sbo5.setButtonId(500); screenManager.checkAndAssignButtonIds(Arrays.asList(sbo1, sbo2, sbo3, sbo4, sbo5), BaseScreenManager.ManagerLocation.SOFTBUTTON_MANAGER); assertEquals("SoftButtonObject id doesn't match the expected value", 100, sbo1.getButtonId()); @@ -253,13 +254,13 @@ public class ScreenManagerTests { // Case 3 - Set ids for some buttons (Manager shouldn't alter the ids set by developer. And it should assign ids for the ones that don't have id) - sbo1 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null); + sbo1 = new SoftButtonObject(null, defaultState, null); sbo1.setButtonId(50); - sbo2 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null); - sbo3 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null); - sbo4 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null); + sbo2 = new SoftButtonObject(null, defaultState, null); + sbo3 = new SoftButtonObject(null, defaultState, null); + sbo4 = new SoftButtonObject(null, defaultState, null); sbo4.setButtonId(100); - sbo5 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null); + sbo5 = new SoftButtonObject(null, defaultState, null); screenManager.checkAndAssignButtonIds(Arrays.asList(sbo1, sbo2, sbo3, sbo4, sbo5), BaseScreenManager.ManagerLocation.SOFTBUTTON_MANAGER); assertEquals("SoftButtonObject id doesn't match the expected value", 50, sbo1.getButtonId()); assertEquals("SoftButtonObject id doesn't match the expected value", 101, sbo2.getButtonId()); |