public void Controller_GetParticipant_Successfully() { var participant = _participants.Take(1).FirstOrDefault(); _repository.Setup(m => m.GetPublicKey(participant.Code)).Returns(participant.Code); _controller.GetParticipant(participant.Code); }
public void TestGetParticipant() { var participant = new Participant(); _groupService.Setup(mocked => mocked.GetParticipantRecord(string.Format("{0} {1}", AuthType, AuthToken))).Returns(participant); var result = _fixture.GetParticipant(); Assert.IsNotNull(result); Assert.IsInstanceOf <OkNegotiatedContentResult <Participant> >(result); var okResult = (OkNegotiatedContentResult <Participant>)result; Assert.IsNotNull(okResult.Content); Assert.AreSame(participant, okResult.Content); }