Skip to content

Commit 449eebd

Browse files
author
Julian Kast
committed
Add unit test to support unique strings for voiceCommands
1 parent a7eba52 commit 449eebd

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManagerTests.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
import org.mockito.invocation.InvocationOnMock;
5353
import org.mockito.stubbing.Answer;
5454

55+
import java.util.ArrayList;
5556
import java.util.Arrays;
5657
import java.util.Collections;
5758
import java.util.List;
@@ -192,4 +193,21 @@ private void sendFakeCoreOnHMIFullNotifications() {
192193
onHMIStatusListener.onNotified(onHMIStatusFakeNotification);
193194
}
194195

196+
/**
197+
* Test If voice commands do not have unique strings, they will not be uploaded
198+
*/
199+
@Test
200+
public void testUniqueStrings() {
201+
List<VoiceCommand> voiceCommandList = new ArrayList<>();
202+
VoiceCommand command1 = new VoiceCommand(Arrays.asList("Command one", "Command two"), null);
203+
VoiceCommand command2 = new VoiceCommand(Arrays.asList("Command one", "Command two"), null);
204+
205+
voiceCommandList.add(command1);
206+
voiceCommandList.add(command2);
207+
voiceCommandManager.currentHMILevel = HMILevel.HMI_NONE;
208+
voiceCommandManager.setVoiceCommands(voiceCommandList);
209+
210+
assertNull(voiceCommandManager.voiceCommands);
211+
}
212+
195213
}

0 commit comments

Comments
 (0)