Search in sources :

Example 56 with FormEntryPrompt

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);
}
Also used : FormEntryPrompt(org.javarosa.form.api.FormEntryPrompt) Test(org.junit.Test)

Example 57 with FormEntryPrompt

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());
}
Also used : FormEntryPrompt(org.javarosa.form.api.FormEntryPrompt) Test(org.junit.Test)

Example 58 with FormEntryPrompt

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));
}
Also used : FormEntryPrompt(org.javarosa.form.api.FormEntryPrompt) MockFormEntryPromptBuilder(org.odk.collect.android.support.MockFormEntryPromptBuilder) Test(org.junit.Test)

Example 59 with FormEntryPrompt

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));
}
Also used : FormEntryPrompt(org.javarosa.form.api.FormEntryPrompt) MockFormEntryPromptBuilder(org.odk.collect.android.support.MockFormEntryPromptBuilder) Test(org.junit.Test)

Example 60 with FormEntryPrompt

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));
}
Also used : FormEntryPrompt(org.javarosa.form.api.FormEntryPrompt) MockFormEntryPromptBuilder(org.odk.collect.android.support.MockFormEntryPromptBuilder) Test(org.junit.Test)

Aggregations

FormEntryPrompt (org.javarosa.form.api.FormEntryPrompt)114 Test (org.junit.Test)92 MockFormEntryPromptBuilder (org.odk.collect.android.support.MockFormEntryPromptBuilder)45 Clip (org.odk.collect.audioclips.Clip)13 FormIndex (org.javarosa.core.model.FormIndex)10 File (java.io.File)9 SelectChoice (org.javarosa.core.model.SelectChoice)7 StringData (org.javarosa.core.model.data.StringData)7 IFormElement (org.javarosa.core.model.IFormElement)5 QuestionDef (org.javarosa.core.model.QuestionDef)5 FormController (org.odk.collect.android.javarosawrapper.FormController)5 GroupDef (org.javarosa.core.model.GroupDef)4 QuestionDetails (org.odk.collect.android.formentry.questions.QuestionDetails)4 DatePickerDetails (org.odk.collect.android.logic.DatePickerDetails)4 ArrayList (java.util.ArrayList)3 DateData (org.javarosa.core.model.data.DateData)3 IAnswerData (org.javarosa.core.model.data.IAnswerData)3 TreeReference (org.javarosa.core.model.instance.TreeReference)3 LocalDateTime (org.joda.time.LocalDateTime)3 AudioControllerView (org.odk.collect.android.audio.AudioControllerView)3