public async Task UpdateUserApi_ValidArguments_InvokeRepositoryAndPublishEvent() { await _userApiService.UpdateUserApi(new UserApi()); _repositoryMock.Verify(c => c.UpdateAsync(It.IsAny <UserApi>()), Times.Once); _mediatorMock.Verify(c => c.Publish(It.IsAny <EntityUpdated <UserApi> >(), default(CancellationToken)), Times.Once); }