public async Task GetUser_Should_InvokeRemoteGraphServiceGetAsync_Once() { await _remoteGraphService.GetUserAsync(_user.Id); _graphServiceClient.Verify(x => x.Users[_user.Id], Times.Once); _mockUserRequestBuilder.Verify(x => x.Request(), Times.Once); _mockUserRequest.Verify(x => x.GetAsync(), Times.Once); }
public async Task <AdUser> GetUserAsync(string id) { Guard.IsValidGuidOrEmail(id); var user = await _remoteGraphService.GetUserAsync(id); if (IsActiveUser(user)) { var adUser = _mapper.Map <AdUser>(user); return(adUser); } throw new EntityNotFoundException($"User '{id}' was not found.", id); }