Search in sources :

Example 1 with AnswersProvider

use of org.odk.collect.android.formentry.questions.AnswersProvider in project collect by opendatakit.

the class FormEntryMenuDelegateTest method setup.

@Before
public void setup() {
    activity = RobolectricHelpers.createThemedActivity(AppCompatActivity.class, R.style.Theme_MaterialComponents);
    FormController formController = mock(FormController.class);
    answersProvider = mock(AnswersProvider.class);
    formSaveViewModel = mock(FormSaveViewModel.class);
    audioRecorder = mock(AudioRecorder.class);
    when(audioRecorder.isRecording()).thenReturn(false);
    formEntryViewModel = mock(FormEntryViewModel.class);
    when(formEntryViewModel.hasBackgroundRecording()).thenReturn(new MutableNonNullLiveData<>(false));
    BackgroundLocationViewModel backgroundLocationViewModel = mock(BackgroundLocationViewModel.class);
    backgroundAudioViewModel = mock(BackgroundAudioViewModel.class);
    when(backgroundAudioViewModel.isBackgroundRecordingEnabled()).thenReturn(new MutableNonNullLiveData<>(true));
    formEntryMenuDelegate = new FormEntryMenuDelegate(activity, answersProvider, mock(FormIndexAnimationHandler.class), formSaveViewModel, formEntryViewModel, audioRecorder, backgroundLocationViewModel, backgroundAudioViewModel, TestSettingsProvider.getSettingsProvider());
    formEntryMenuDelegate.formLoaded(formController);
}
Also used : FormController(org.odk.collect.android.javarosawrapper.FormController) BackgroundLocationViewModel(org.odk.collect.android.formentry.backgroundlocation.BackgroundLocationViewModel) FormSaveViewModel(org.odk.collect.android.formentry.saving.FormSaveViewModel) AppCompatActivity(androidx.appcompat.app.AppCompatActivity) AudioRecorder(org.odk.collect.audiorecorder.recording.AudioRecorder) AnswersProvider(org.odk.collect.android.formentry.questions.AnswersProvider) Before(org.junit.Before)

Aggregations

AppCompatActivity (androidx.appcompat.app.AppCompatActivity)1 Before (org.junit.Before)1 BackgroundLocationViewModel (org.odk.collect.android.formentry.backgroundlocation.BackgroundLocationViewModel)1 AnswersProvider (org.odk.collect.android.formentry.questions.AnswersProvider)1 FormSaveViewModel (org.odk.collect.android.formentry.saving.FormSaveViewModel)1 FormController (org.odk.collect.android.javarosawrapper.FormController)1 AudioRecorder (org.odk.collect.audiorecorder.recording.AudioRecorder)1