    @Test
    public void getAssignmentCourses() {

        // Prepare LiveData
        MutableLiveData<RemoteResource<List<MoodleAssignmentCourse>>> liveData = new MutableLiveData<>();
        when(repository.getAssignmentCourses()).thenReturn(liveData);

        // Prepare Observer
        Observer<RemoteResource<List<MoodleAssignmentCourse>>> observer = mock(Observer.class);
        viewModel.getAssignmentCourses().observeForever(observer);
        verify(observer, never()).onChanged(any(RemoteResource.class));

        // Set a value and check if onChanged was called
        RemoteResource<List<MoodleAssignmentCourse>> remoteRes = RemoteResource.loading(null);
        liveData.setValue(remoteRes);
        verify(observer).onChanged(remoteRes);

        reset(observer);

        // Set another value and check if onChanged was called
        List<MoodleAssignmentCourse> list = new ArrayList<>();
        remoteRes = RemoteResource.success(list);
        liveData.setValue(remoteRes);
        verify(observer).onChanged(any(RemoteResource.class));
    }