private OrganisationControllerBuilder(List <Claim> claims) { createOrganisationService = Mock.Of <ICreateOrganisationService>(); organisationRepository = Mock.Of <IOrganisationRepository>(); serviceRecipientRepository = Mock.Of <IServiceRecipientRepository>(); claimsPrincipal = new ClaimsPrincipal(new ClaimsIdentity(claims, "mock")); }
public OrganisationsController( IOrganisationRepository organisationRepository, ICreateOrganisationService createOrganisationService, IServiceRecipientRepository serviceRecipientRepository) { _organisationRepository = organisationRepository ?? throw new ArgumentNullException(nameof(organisationRepository)); _createOrganisationService = createOrganisationService ?? throw new ArgumentNullException(nameof(createOrganisationService)); _serviceRecipientRepository = serviceRecipientRepository ?? throw new ArgumentNullException(nameof(serviceRecipientRepository)); }
private OrganisationControllerBuilder(Guid primaryOrganisationId) { createOrganisationService = Mock.Of <ICreateOrganisationService>(); organisationRepository = Mock.Of <IOrganisationRepository>(); serviceRecipientRepository = Mock.Of <IServiceRecipientRepository>(); var claims = new[] { new Claim("primaryOrganisationId", primaryOrganisationId.ToString()) }; claimsPrincipal = new ClaimsPrincipal(new ClaimsIdentity(claims, "mock")); }
private OrganisationControllerBuilder WithCreateOrganisationServiceReturningResult(Result <Guid?> result) { WithCreateOrganisation(); var createOrganisationService = new Mock <ICreateOrganisationService>(); createOrganisationService.Setup(s => s.CreateAsync(It.IsAny <CreateOrganisationRequest>())) .ReturnsAsync(result); _createOrganisationService = createOrganisationService.Object; return(this); }