use of org.javarosa.form.api.FormEntryPrompt in project collect by opendatakit.
the class InternalRecordingRequesterTest method requestRecording_startsWithAAC.
@Test
public void requestRecording_startsWithAAC() {
FormEntryPrompt prompt = promptWithAnswer(null);
requester.requestRecording(prompt);
verify(audioRecorder).start(prompt.getIndex(), Output.AAC);
}
use of org.javarosa.form.api.FormEntryPrompt in project collect by opendatakit.
the class InternalRecordingRequesterTest method requestRecording_whenPermissionDenied_doesNothing.
@Test
public void requestRecording_whenPermissionDenied_doesNothing() {
permissionsProvider.setPermissionGranted(false);
FormEntryPrompt prompt = promptWithAnswer(null);
requester.requestRecording(prompt);
verify(audioRecorder, never()).start(any(), any());
}
use of org.javarosa.form.api.FormEntryPrompt in project collect by opendatakit.
the class RecordingRequesterProviderTest method whenQualityIsVoiceOnly_andSettingExternalPreferred_createsInternalRecordingRequester.
@Test
public void whenQualityIsVoiceOnly_andSettingExternalPreferred_createsInternalRecordingRequester() {
FormEntryPrompt prompt = new MockFormEntryPromptBuilder().withBindAttribute("odk", "quality", "voice-only").build();
RecordingRequester recordingRequester = provider.create(prompt, true);
assertThat(recordingRequester, instanceOf(InternalRecordingRequester.class));
}
use of org.javarosa.form.api.FormEntryPrompt in project collect by opendatakit.
the class RecordingRequesterProviderTest method whenQualityIsExternal_andSettingExternalNotPreferred_createsExternalRecordingRequester.
@Test
public void whenQualityIsExternal_andSettingExternalNotPreferred_createsExternalRecordingRequester() {
FormEntryPrompt prompt = new MockFormEntryPromptBuilder().withBindAttribute("odk", "quality", "external").build();
RecordingRequester recordingRequester = provider.create(prompt, false);
assertThat(recordingRequester, instanceOf(ExternalAppRecordingRequester.class));
}
use of org.javarosa.form.api.FormEntryPrompt in project collect by opendatakit.
the class RecordingRequesterProviderTest method whenQualityIsNormal_andSettingExternalNotPreferred_createsInternalRecordingRequester.
@Test
public void whenQualityIsNormal_andSettingExternalNotPreferred_createsInternalRecordingRequester() {
FormEntryPrompt prompt = new MockFormEntryPromptBuilder().withBindAttribute("odk", "quality", "normal").build();
RecordingRequester recordingRequester = provider.create(prompt, false);
assertThat(recordingRequester, instanceOf(InternalRecordingRequester.class));
}
Aggregations