public UpdateSchemeContactDetailsHandler(IWeeeAuthorization authorization, IOrganisationDetailsDataAccess dataAccess,
                                          IWeeeEmailService weeeEmailService)
 {
     this.authorization    = authorization;
     this.dataAccess       = dataAccess;
     this.weeeEmailService = weeeEmailService;
 }
示例#2
0
        public OrganisationUserRequestCompletedEventHandlerTests()
        {
            this.emailService = A.Fake <IWeeeEmailService>();
            this.dataAccess   = A.Fake <IOrganisationUserRequestEventHandlerDataAccess>();

            this.handler = new OrganisationUserRequestCompletedEventHandler(dataAccess, emailService);
        }
示例#3
0
        public OrganisationUserRequestEventHandlerTests()
        {
            dataAccess   = A.Fake <IOrganisationUserRequestEventHandlerDataAccess>();
            emailService = A.Fake <IWeeeEmailService>();

            handler = new OrganisationUserRequestEventHandler(dataAccess, emailService);
        }
 public SchemeDataReturnSubmissionEventHandler(
     IWeeeEmailService weeeEmailService,
     ISchemeDataReturnSubmissionEventHandlerDataAccess dataAccess)
 {
     this.weeeEmailService = weeeEmailService;
     this.dataAccess       = dataAccess;
 }
示例#5
0
 public UnauthenticatedUserController(
     ApplicationUserManager userManager,
     IUserContext userContext,
     IWeeeEmailService emailService,
     IGetAdminUserDataAccess getAdminUserDataAccess)
 {
     this.userManager            = userManager;
     this.userContext            = userContext;
     this.emailService           = emailService;
     this.getAdminUserDataAccess = getAdminUserDataAccess;
 }
 public UnauthenticatedUserController(
     ApplicationUserManager userManager,
     IUserContext userContext,
     IWeeeEmailService emailService,
     IGetAdminUserDataAccess getAdminUserDataAccess)
 {
     this.userManager = userManager;
     this.userContext = userContext;
     this.emailService = emailService;
     this.getAdminUserDataAccess = getAdminUserDataAccess;
 }
示例#7
0
        public async Task CreateExternalUser_WithValidModel_IssuesCanAccessExternalAreaClaim()
        {
            // Arrange
            ApplicationUser        capturedUser = null;
            ApplicationUserManager userManager  = A.Fake <ApplicationUserManager>();

            A.CallTo(() => userManager.CreateAsync(A <ApplicationUser> ._))
            .Invokes((ApplicationUser user) => capturedUser = user)
            .Returns(IdentityResult.Success);

            A.CallTo(() => userManager.CreateAsync(A <ApplicationUser> ._, A <string> ._))
            .Invokes((ApplicationUser user, string password) => capturedUser = user)
            .Returns(IdentityResult.Success);

            IUserContext            userContext            = A.Fake <IUserContext>();
            IWeeeEmailService       emailService           = A.Fake <IWeeeEmailService>();
            IGetAdminUserDataAccess getAdminUserDataAccess = A.Dummy <IGetAdminUserDataAccess>();

            UnauthenticatedUserController controller = new UnauthenticatedUserController(
                userManager,
                userContext,
                emailService,
                getAdminUserDataAccess);

            ExternalUserCreationData model = new ExternalUserCreationData()
            {
                FirstName         = "John",
                Surname           = "Smith",
                Email             = "*****@*****.**",
                Password          = "******",
                ConfirmPassword   = "******",
                ActivationBaseUrl = "ActivationBaseUrl"
            };

            // Act
            await controller.CreateExternalUser(model);

            // Assert
            Assert.NotNull(capturedUser);

            int claimCount = capturedUser.Claims.Count(
                c => c.ClaimType == ClaimTypes.AuthenticationMethod &&
                c.ClaimValue == Claims.CanAccessExternalArea);

            Assert.True(claimCount == 1, "A single \"CanAccessExterna;Area\" claim was not issued to the user.");
        }
示例#8
0
 public SchemeMemberSubmissionEventHandler(IWeeeEmailService weeeEmailService)
 {
     this.weeeEmailService = weeeEmailService;
 }
示例#9
0
 public SendTestEmailHandler(IWeeeAuthorization authorization, IWeeeEmailService weeeEmailService)
 {
     this.authorization    = authorization;
     this.weeeEmailService = weeeEmailService;
 }
示例#10
0
        public ContactDetailsUpdateEventHandlerTests()
        {
            emailService = A.Fake <IWeeeEmailService>();

            handler = new ContactDetailsUpdateEventHandler(this.emailService);
        }
 public ContactDetailsUpdateEventHandler(IWeeeEmailService emailService)
 {
     this.emailService = emailService;
 }
 public OrganisationUserRequestCompletedEventHandler(IOrganisationUserRequestEventHandlerDataAccess dataAccess, IWeeeEmailService emailService)
 {
     this.emailService = emailService;
     this.dataAccess   = dataAccess;
 }