Search in sources :

Example 11 with MockFormEntryPromptBuilder

use of org.odk.collect.android.support.MockFormEntryPromptBuilder 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 12 with MockFormEntryPromptBuilder

use of org.odk.collect.android.support.MockFormEntryPromptBuilder 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 13 with MockFormEntryPromptBuilder

use of org.odk.collect.android.support.MockFormEntryPromptBuilder 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)

Example 14 with MockFormEntryPromptBuilder

use of org.odk.collect.android.support.MockFormEntryPromptBuilder in project collect by opendatakit.

the class RecordingRequesterProviderTest method whenQualityIsLow_andSettingExternalPreferred_createsInternalRecordingRequester.

@Test
public void whenQualityIsLow_andSettingExternalPreferred_createsInternalRecordingRequester() {
    FormEntryPrompt prompt = new MockFormEntryPromptBuilder().withBindAttribute("odk", "quality", "low").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 15 with MockFormEntryPromptBuilder

use of org.odk.collect.android.support.MockFormEntryPromptBuilder in project collect by opendatakit.

the class RecordingRequesterProviderTest method whenNoQualitySpecified_andSettingExternalNotPreferred_createsInternalRecordingRequester.

@Test
public void whenNoQualitySpecified_andSettingExternalNotPreferred_createsInternalRecordingRequester() {
    FormEntryPrompt prompt = new MockFormEntryPromptBuilder().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

MockFormEntryPromptBuilder (org.odk.collect.android.support.MockFormEntryPromptBuilder)69 Test (org.junit.Test)65 FormEntryPrompt (org.javarosa.form.api.FormEntryPrompt)45 SelectChoice (org.javarosa.core.model.SelectChoice)21 Clip (org.odk.collect.audioclips.Clip)12 RandomString (net.bytebuddy.utility.RandomString)9 FileWidgetTest (org.odk.collect.android.widgets.base.FileWidgetTest)9 ImageView (android.widget.ImageView)8 AppDependencyModule (org.odk.collect.android.injection.config.AppDependencyModule)8 SynchronousImageLoader (org.odk.collect.android.widgets.support.SynchronousImageLoader)8 ImageLoader (org.odk.collect.imageloader.ImageLoader)8 BitmapDrawable (android.graphics.drawable.BitmapDrawable)7 Drawable (android.graphics.drawable.Drawable)7 GeneralSelectOneWidgetTest (org.odk.collect.android.widgets.base.GeneralSelectOneWidgetTest)7 Pair (androidx.core.util.Pair)6 TextView (android.widget.TextView)5 GeneralSelectMultiWidgetTest (org.odk.collect.android.widgets.base.GeneralSelectMultiWidgetTest)5 File (java.io.File)4 ReferenceManager (org.javarosa.core.reference.ReferenceManager)4 CollectHelpers.setupFakeReferenceManager (org.odk.collect.android.support.CollectHelpers.setupFakeReferenceManager)4