public async Task InsertUserApi_ValidArguments_InvokeRepositoryAndPublishEvent() { await _userApiService.InsertUserApi(new UserApi()); _repositoryMock.Verify(c => c.InsertAsync(It.IsAny <UserApi>()), Times.Once); _mediatorMock.Verify(c => c.Publish(It.IsAny <EntityInserted <UserApi> >(), default(CancellationToken)), Times.Once); }