Exemplo n.º 1
0
        public void ExchangeAccessToken_InvalidAccessToken_RespondsWithUnauthorized()
        {
            var candidate = new Candidate {
                Id = Guid.NewGuid()
            };

            _mockCrm.Setup(mock => mock.MatchCandidate(_request)).Returns(candidate);
            _mockTokenService.Setup(mock => mock.IsValid("000000", _request, (Guid)candidate.Id)).Returns(false);

            var response = _controller.ExchangeAccessToken("000000", _request);

            response.Should().BeOfType <UnauthorizedResult>();
        }