public AccountController(
     ApplicationUserManager userManager,
     IUserRegisterer userRegisterer,
     IFirstTimeAuthenticator firstTimeAuthenticator,
     IAuthenticationManager authenticationManager,
     IGamingGroupInviteConsumer gamingGroupInvitationConsumer,
     IGamingGroupRetriever gamingGroupRetriever,
     IBoardGameGeekUserSaver boardGameGeekUserSaver,
     IBoardGameGeekApiClient boardGameGeekApiClient,
     IUserRetriever userRetriever,
     ITransformer transformer,
     IGamingGroupContextSwitcher gamingGroupContextSwitcher)
 {
     _userManager                   = userManager;
     _userRegisterer                = userRegisterer;
     _firstTimeAuthenticator        = firstTimeAuthenticator;
     _authenticationManager         = authenticationManager;
     _gamingGroupInvitationConsumer = gamingGroupInvitationConsumer;
     _gamingGroupRetriever          = gamingGroupRetriever;
     _boardGameGeekUserSaver        = boardGameGeekUserSaver;
     _boardGameGeekApiClient        = boardGameGeekApiClient;
     _userRetriever                 = userRetriever;
     _transformer                   = transformer;
     _gamingGroupContextSwitcher    = gamingGroupContextSwitcher;
 }
        public virtual void SetUp()
        {
            userStoreMock = MockRepository.GenerateMock <IUserStore <ApplicationUser> >();
            gamingGroupInviteConsumerMock = MockRepository.GenerateMock <IGamingGroupInviteConsumer>();
            userRegistererMock            = MockRepository.GenerateMock <IUserRegisterer>();
            firstTimeAuthenticatorMock    = MockRepository.GenerateMock <IFirstTimeAuthenticator>();
            authenticationManagerMock     = MockRepository.GenerateMock <IAuthenticationManager>();
            var dataProtector = MockRepository.GenerateMock <IDataProtector>();

            dataProtectionProviderMock = MockRepository.GenerateMock <IDataProtectionProvider>();
            gamingGroupRetrieverMock   = MockRepository.GenerateMock <IGamingGroupRetriever>();

            boardGameGeekUserSaver     = MockRepository.GenerateMock <IBoardGameGeekUserSaver>();
            boardGameGeekApiClient     = MockRepository.GenerateMock <IBoardGameGeekApiClient>();
            userRetriever              = MockRepository.GenerateMock <IUserRetriever>();
            transformerMock            = MockRepository.GenerateMock <ITransformer>();
            gamingGroupContextSwitcher = MockRepository.GenerateMock <IGamingGroupContextSwitcher>();

            dataProtectionProviderMock.Expect(mock => mock.Create(Arg <string> .Is.Anything)).Return(dataProtector);

            userManager = new ApplicationUserManager(userStoreMock, dataProtectionProviderMock);
            accountControllerPartialMock = MockRepository.GeneratePartialMock <AccountController>(
                userManager,
                userRegistererMock,
                firstTimeAuthenticatorMock,
                authenticationManagerMock,
                gamingGroupInviteConsumerMock,
                gamingGroupRetrieverMock,
                boardGameGeekUserSaver,
                boardGameGeekApiClient,
                userRetriever,
                transformerMock,
                gamingGroupContextSwitcher);
            currentUser = new ApplicationUser()
            {
                Id = "new application user",
                CurrentGamingGroupId = 1
            };
            registerViewModel = new RegisterViewModel()
            {
                ConfirmPassword = "******",
                Password        = "******",
                UserName        = "******",
                EmailAddress    = "*****@*****.**"
            };
        }
        public virtual void SetUp()
        {
            userStoreMock = MockRepository.GenerateMock<IUserStore<ApplicationUser>>();
            gamingGroupInviteConsumerMock = MockRepository.GenerateMock<IGamingGroupInviteConsumer>();
            userRegistererMock = MockRepository.GenerateMock<IUserRegisterer>();
            this.firstTimeAuthenticatorMock = MockRepository.GenerateMock<IFirstTimeAuthenticator>();
            this.authenticationManagerMock = MockRepository.GenerateMock<IAuthenticationManager>();
            var dataProtector = MockRepository.GenerateMock<IDataProtector>();
            dataProtectionProviderMock = MockRepository.GenerateMock<IDataProtectionProvider>();
            gamingGroupRetrieverMock = MockRepository.GenerateMock<IGamingGroupRetriever>();
            
            boardGameGeekUserSaver = MockRepository.GenerateMock<IBoardGameGeekUserSaver>();
            boardGameGeekApiClient = MockRepository.GenerateMock<IBoardGameGeekApiClient>();
            userRetriever = MockRepository.GenerateMock<IUserRetriever>();

            dataProtectionProviderMock.Expect(mock => mock.Create(Arg<string>.Is.Anything)).Return(dataProtector);

            userManager = new ApplicationUserManager(userStoreMock, dataProtectionProviderMock);
            accountControllerPartialMock = MockRepository.GeneratePartialMock<AccountController>(
                userManager,
                userRegistererMock,
                this.firstTimeAuthenticatorMock,
                this.authenticationManagerMock,
                gamingGroupInviteConsumerMock, 
                gamingGroupRetrieverMock,
                boardGameGeekUserSaver,
                boardGameGeekApiClient,
                userRetriever);
            currentUser = new ApplicationUser()
            {
                Id = "new application user",
                CurrentGamingGroupId = 1
            };
            registerViewModel = new RegisterViewModel()
            {
                ConfirmPassword = "******",
                Password = "******",
                UserName = "******",
                EmailAddress = "*****@*****.**"
            };
        }
Beispiel #4
0
 public AccountController(
     ApplicationUserManager userManager,
     IUserRegisterer userRegisterer,
     IFirstTimeAuthenticator firstTimeAuthenticator,
     IAuthenticationManager authenticationManager,
     IGamingGroupInviteConsumer gamingGroupInvitationConsumer,
     IGamingGroupRetriever gamingGroupRetriever,
     IBoardGameGeekUserSaver boardGameGeekUserSaver,
     IBoardGameGeekApiClient boardGameGeekApiClient,
     IUserRetriever userRetriever)
 {
     this.userManager                   = userManager;
     this.userRegisterer                = userRegisterer;
     this.firstTimeAuthenticator        = firstTimeAuthenticator;
     this.authenticationManager         = authenticationManager;
     this.gamingGroupInvitationConsumer = gamingGroupInvitationConsumer;
     _gamingGroupRetriever              = gamingGroupRetriever;
     _boardGameGeekUserSaver            = boardGameGeekUserSaver;
     _boardGameGeekApiClient            = boardGameGeekApiClient;
     _userRetriever = userRetriever;
 }
 public AccountController(
     ApplicationUserManager userManager,
     IUserRegisterer userRegisterer,
     IFirstTimeAuthenticator firstTimeAuthenticator,
     IAuthenticationManager authenticationManager,
     IGamingGroupInviteConsumer gamingGroupInvitationConsumer,
     IGamingGroupRetriever gamingGroupRetriever,
     IBoardGameGeekUserSaver boardGameGeekUserSaver,
     IBoardGameGeekApiClient boardGameGeekApiClient,
     IUserRetriever userRetriever)
 {
     this.userManager = userManager;
     this.userRegisterer = userRegisterer;
     this.firstTimeAuthenticator = firstTimeAuthenticator;
     this.authenticationManager = authenticationManager;
     this.gamingGroupInvitationConsumer = gamingGroupInvitationConsumer;
     _gamingGroupRetriever = gamingGroupRetriever;
     _boardGameGeekUserSaver = boardGameGeekUserSaver;
     _boardGameGeekApiClient = boardGameGeekApiClient;
     _userRetriever = userRetriever;
 }