use of org.odk.collect.android.projects.CurrentProjectProvider in project collect by opendatakit.
the class FormSaveViewModelTest method setup.
@Before
public void setup() {
// Useful given some methods will execute AsyncTasks
Robolectric.getBackgroundThreadScheduler().pause();
formController = mock(FormController.class);
logger = mock(AuditEventLogger.class);
mediaUtils = mock(MediaUtils.class);
Analytics analytics = mock(Analytics.class);
when(formController.getAuditEventLogger()).thenReturn(logger);
when(logger.isChangeReasonRequired()).thenReturn(false);
audioRecorder = mock(AudioRecorder.class);
currentProjectProvider = mock(CurrentProjectProvider.class);
when(currentProjectProvider.getCurrentProject()).thenReturn(Project.Companion.getDEMO_PROJECT());
viewModel = new FormSaveViewModel(savedStateHandle, () -> CURRENT_TIME, formSaver, mediaUtils, analytics, scheduler, audioRecorder, currentProjectProvider);
viewModel.formLoaded(formController);
}
Aggregations