public async Task Then_repository_is_called_with_correct_Id() { var repository = new Mock <IContactQueryRepository>(); var controller = new ContactQueryController(repository.Object, null, null, null, null); var userId = Guid.NewGuid(); await controller.GetPrivilegesForContact(userId); repository.Verify(repo => repo.GetPrivilegesFor(userId)); }
protected void Setup() { SetupOrchestratorMocks(); SetupControllerMocks(); MediatorMock = new Mock <IMediator>(); ContactQueryController = new ContactQueryController( ContactQueryRepositoryMock.Object, _searchOrganisationForContactsValidator, MediatorMock.Object, ControllerLoggerMock.Object, new Mock <IWebConfiguration>().Object); }
public void Arrange() { Setup(); MappingBootstrapper.Initialize(); _contactResponse = Builder <Contact> .CreateNew().Build(); ContactQueryRepositoryMock.Setup(q => q.GetContact(Moq.It.IsAny <string>())) .Returns(Task.FromResult((_contactResponse))); _result = ContactQueryController.SearchContactByUserName("TestUser").Result; }
public void Arrange() { Setup(); MappingBootstrapper.Initialize(); var contacts = Builder <Contact> .CreateListOfSize(10).Build().AsEnumerable(); ContactQueryRepositoryMock.Setup(q => q.GetContactsForEpao(Moq.It.IsAny <string>())) .Returns(Task.FromResult((contacts))); OrganisationQueryRepositoryMock.Setup(q => q.CheckIfAlreadyExists(Moq.It.IsAny <string>())) .Returns(Task.FromResult <bool>(true)); var endPointAssessorOrganisationId = "EPA1234"; _result = ContactQueryController.SearchContactsForAnOrganisation(endPointAssessorOrganisationId).Result; }