Skip to content

Commit e183f35

Browse files
committed
Update ScreenManagerTests test
Update ScreenManagerTests.testAssigningIdsToSoftButtonObjects())
1 parent 528769f commit e183f35

1 file changed

Lines changed: 16 additions & 15 deletions

File tree

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

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,15 @@ public void testSettingSoftButtonId() {
217217
}
218218
@Test
219219
public void testAssigningIdsToSoftButtonObjects() {
220+
SoftButtonState defaultState = new SoftButtonState("default", "hi", null);
220221
SoftButtonObject sbo1, sbo2, sbo3, sbo4, sbo5;
221222

222223
// Case 1 - don't set id for any button (Manager should set ids automatically starting from 1 and up)
223-
sbo1 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
224-
sbo2 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
225-
sbo3 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
226-
sbo4 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
227-
sbo5 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
224+
sbo1 = new SoftButtonObject(null, defaultState, null);
225+
sbo2 = new SoftButtonObject(null, defaultState, null);
226+
sbo3 = new SoftButtonObject(null, defaultState, null);
227+
sbo4 = new SoftButtonObject(null, defaultState, null);
228+
sbo5 = new SoftButtonObject(null, defaultState, null);
228229
screenManager.checkAndAssignButtonIds(Arrays.asList(sbo1, sbo2, sbo3, sbo4, sbo5), BaseScreenManager.ManagerLocation.SOFTBUTTON_MANAGER);
229230
assertEquals("SoftButtonObject id doesn't match the expected value", 1, sbo1.getButtonId());
230231
assertEquals("SoftButtonObject id doesn't match the expected value", 2, sbo2.getButtonId());
@@ -234,15 +235,15 @@ public void testAssigningIdsToSoftButtonObjects() {
234235

235236

236237
// Case 2 - Set ids for all buttons (Manager shouldn't alter the ids set by developer)
237-
sbo1 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
238+
sbo1 = new SoftButtonObject(null, defaultState, null);
238239
sbo1.setButtonId(100);
239-
sbo2 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
240+
sbo2 = new SoftButtonObject(null, defaultState, null);
240241
sbo2.setButtonId(200);
241-
sbo3 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
242+
sbo3 = new SoftButtonObject(null, defaultState, null);
242243
sbo3.setButtonId(300);
243-
sbo4 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
244+
sbo4 = new SoftButtonObject(null, defaultState, null);
244245
sbo4.setButtonId(400);
245-
sbo5 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
246+
sbo5 = new SoftButtonObject(null, defaultState, null);
246247
sbo5.setButtonId(500);
247248
screenManager.checkAndAssignButtonIds(Arrays.asList(sbo1, sbo2, sbo3, sbo4, sbo5), BaseScreenManager.ManagerLocation.SOFTBUTTON_MANAGER);
248249
assertEquals("SoftButtonObject id doesn't match the expected value", 100, sbo1.getButtonId());
@@ -253,13 +254,13 @@ public void testAssigningIdsToSoftButtonObjects() {
253254

254255

255256
// 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)
256-
sbo1 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
257+
sbo1 = new SoftButtonObject(null, defaultState, null);
257258
sbo1.setButtonId(50);
258-
sbo2 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
259-
sbo3 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
260-
sbo4 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
259+
sbo2 = new SoftButtonObject(null, defaultState, null);
260+
sbo3 = new SoftButtonObject(null, defaultState, null);
261+
sbo4 = new SoftButtonObject(null, defaultState, null);
261262
sbo4.setButtonId(100);
262-
sbo5 = new SoftButtonObject(null, Collections.EMPTY_LIST, null, null);
263+
sbo5 = new SoftButtonObject(null, defaultState, null);
263264
screenManager.checkAndAssignButtonIds(Arrays.asList(sbo1, sbo2, sbo3, sbo4, sbo5), BaseScreenManager.ManagerLocation.SOFTBUTTON_MANAGER);
264265
assertEquals("SoftButtonObject id doesn't match the expected value", 50, sbo1.getButtonId());
265266
assertEquals("SoftButtonObject id doesn't match the expected value", 101, sbo2.getButtonId());

0 commit comments

Comments
 (0)