Example #1
0
        public void Collaborator_SearchCollaborator_FoundSuccessfully(long id)
        {
            _collaboratorRepository.GetById(id).Returns <Collaborator>(new Collaborator {
            });
            var result = _collaboratorRepository.GetById(id);

            Assert.NotNull(result, message: "The result is null");
        }
Example #2
0
        public async Task <IActionResult> Details(Guid id)
        {
            var collaboratorViewModel = _mapper.Map <CollaboratorViewModel>(await _collaboratorRepository.GetById(id));

            if (collaboratorViewModel == null)
            {
                return(NotFound());
            }

            return(View(collaboratorViewModel));
        }
        public void UpdateCollaborator(Collaborator collaborator)
        {
            var existingCollaborator = collaboratorRepository.GetById(collaborator.CollaboratorId);

            if (existingCollaborator != null)
            {
                existingCollaborator.Status = collaborator.Status;
                SaveCollaborator();
            }
        }
Example #4
0
 public Collaborator GetById(long id)
 {
     return(_collaboratorRepository.GetById(id));
 }