protected override void Context() { AccountService = MockRepository.GenerateStub<IAccountService>(); Identity = new FakeIdentity(Username); _user = new FakePrincipal(Identity, null); HttpRequest = MockRepository.GenerateStub<HttpRequestBase>(); HttpContext = MockRepository.GenerateStub<HttpContextBase>(); HttpContext.Stub(x => x.Request).Return(HttpRequest); HttpContext.User = _user; _httpResponse = MockRepository.GenerateStub<HttpResponseBase>(); _httpResponse.Stub(x => x.Cookies).Return(new HttpCookieCollection()); HttpContext.Stub(x => x.Response).Return(_httpResponse); Logger = MockRepository.GenerateStub<ILogger>(); WebAuthenticationService = MockRepository.GenerateStub<IWebAuthenticationService>(); MappingEngine = MockRepository.GenerateStub<IMappingEngine>(); AccountCreator = MockRepository.GenerateStub<IAccountCreator>(); AccountController = new AccountController(AccountService, Logger, WebAuthenticationService, MappingEngine, null, AccountCreator); AccountController.ControllerContext = new ControllerContext(HttpContext, new RouteData(), AccountController); }
public AccountController(IAccountService accountService, ILogger logger, IWebAuthenticationService webAuthenticationService, IMappingEngine mappingEngine, IAccountCreator accountCreator, IAccountCreator creator) { _accountService = accountService; _logger = logger; _webAuthenticationService = webAuthenticationService; _mappingEngine = mappingEngine; _accountCreator = accountCreator; }
protected override void Context() { AuthorizationService = MockRepository.GenerateStub<IAuthorizationService>(); ValidatorFactory = MockRepository.GenerateStub<IValidatorFactory>(); AccountRepository = MockRepository.GenerateStub<IAccountRepository>(); CryptographyService = MockRepository.GenerateStub<ICryptographyService>(); EmailService = MockRepository.GenerateStub<IEmailService>(); SettingsProvider = MockRepository.GenerateStub<ISettingsProvider>(); AccountCreator = new AccountCreator(AuthorizationService, ValidatorFactory, AccountRepository, CryptographyService, EmailService, SettingsProvider); }
public void Execute(IServiceProvider serviceProvider) { IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext)); IOrganizationServiceFactory factory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory)); IOrganizationService service = factory.CreateOrganizationService(context.UserId); Entity Target = (Entity)context.InputParameters["Target"]; MefDependencyResolver resolver = new MefDependencyResolver(service); IAccountCreator accountCreator = resolver.GetInstance <IAccountCreator>(); accountCreator.CreateAccount(); }
public Authorization(IAccountCreator creator, ILoginHandler handler) { _creator = creator; _handler = handler; }
public AccountService(IAccountCreator creator, IFakeRepository repository) { this.creator = creator ?? throw new ArgumentNullException($"Argument {nameof(creator)} is null"); this.repository = repository ?? throw new ArgumentNullException($"Argument {nameof(repository)} is null"); }
public ModelCreator(IUserCreator userCreator, IAccountCreator accountCreator) { this.UserCreator = userCreator; this.AccountCreator = accountCreator; }
public AccountController(IAccountCreator accountCreator) { _accountCreator = accountCreator; }
static void Run() { IAccountCreator accountCreator = serviceProvider.GetService <IAccountCreator>(); accountCreator.CreateAccounts(); }
public static Account ToAccount(this AccountDto dto, IAccountCreator creator) { return(creator.Create(dto)); }
public CreateAccountController(IAccountCreator accountCreator, IAccountCreationInformationValidator validator) { _accountCreator = accountCreator; _validator = validator; }
public DataReaderAccountConverter(IAccountCreator accountCreator) { this.AccountCreator = accountCreator; }