public async Task MergeOperation_CheckIfWorkspaceHasIncludedPendingChangesAsync_WhenCalledWithPendingChangesInWorkspace_ThenThrowsException() { _configManager.Expect(x => x.GetValue <bool>(ConfigKeys.ENABLE_WARNING_WHEN_PENDING_CHANGES)) .Return(true); _mergeService.Expect(x => x.HasIncludedPendingChanges(_currentWorkspaceModel)) .Return(true); _sut.MyCurrentAction += InvokesMyCurrentActionWithCheckingPendingChanges; var obj = new PrivateObject(_sut); await(Task) obj.Invoke(CHECK_WORKSPACE_METHOD_NAME, _currentWorkspaceModel); }