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);
}
Aggregations