コード例 #1
0
        public async Task GetGroup_Should_InvokeRemoteGraphServiceGetAsync_Once()
        {
            await _remoteGraphService.GetGroupAsync(_group.Id);

            _mockGroupsCollectionRequestBuilder.Verify(x => x.Request(), Times.Once);
            _mockGroupsCollectionRequest.Verify(x => x.GetAsync(), Times.Once);
        }
コード例 #2
0
        public async Task <AdGroup> GetGroupAsync(string id)
        {
            Guard.IsValidEmail(id);

            var group = await _remoteGraphService.GetGroupAsync(id);

            if (IsActiveGroup(group))
            {
                var adGroup = _mapper.Map <AdGroup>(group);
                return(adGroup);
            }

            throw new EntityNotFoundException($"Group '{id}' was not found.", id);
        }