Exemplo n.º 1
0
        public async Task GetManagerIdOfUser_Should_InvokeRemoteGraphServiceGetUser_Once()
        {
            await _remoteGraphService.GetManagerIdOfUserAsync(_user.Id);

            _graphServiceClient.Verify(x => x.Users[_user.Id], Times.Once);
            _mockUserRequestBuilder.Verify(x => x.Manager, Times.Once);
            _mockReferenceRequestBuilder.Verify(x => x.Request(), Times.Once);
            _mockReferenceRequest.Verify(x => x.Select(i => i.Id), Times.Once);
            _mockReferenceRequest.Verify(x => x.GetAsync(), Times.Once);
        }
Exemplo n.º 2
0
        public async Task <AdUser> GetManagerByUserIdAsync(string id)
        {
            Guard.IsValidGuidOrEmail(id);

            var managerId = await _remoteGraphService.GetManagerIdOfUserAsync(id);

            var manager = await GetUserAsync(managerId);

            return(manager);
        }