Пример #1
0
        public void GivenTsksWhenMapThenLoggedDataAreMappedFromTskWithTlg()
        {
            _tsks.Add(new TSK {
                Items = new [] { new TLG() }
            });
            _documentMapper.Map(_tsks, _dataPath, _dataModel, _linkedIds);

            _loggedDataMapperMock.Verify(x => x.Map(_tsks, _dataPath, _dataModel, _linkedIds), Times.Once);
        }
Пример #2
0
        public GetDocumentsResponse Execute(GetDocumentsRequest request)
        {
            var user = _repository.GetUser(request.UserLogin);

            if (user == null)
            {
                return(new GetDocumentsResponse()
                {
                    Error = $"Cannot find user {request.UserLogin}"
                });
            }

            var documentsRows = user.IsOperator() ?
                                _repository.GetUserDocuments(user.Id) :
                                _repository.GetDocumentsForSigning(user.CompanyId);
            var documents = documentsRows.Select(doc => _documentMapper.Map(doc)).ToList();

            return(new GetDocumentsResponse()
            {
                Success = true,
                Documents = documents
            });
        }