コード例 #1
0
 public BoardGameGeekGamesImporter(IUserRetriever userRetriever, IBoardGameGeekApiClient boardGameGeekApiClient, IGameDefinitionRetriever gameDefinitionRetriever, IGameDefinitionSaver gameDefinitionSaver)
 {
     _userRetriever = userRetriever;
     _boardGameGeekApiClient = boardGameGeekApiClient;
     _gameDefinitionRetriever = gameDefinitionRetriever;
     _gameDefinitionSaver = gameDefinitionSaver;
 }
コード例 #2
0
 public GameDefinitionSaver(IDataContext dataContext, INemeStatsEventTracker eventTracker, IBoardGameGeekApiClient boardGameGeekApiClient, IBoardGameGeekGameDefinitionCreator boardGameGeekGameDefinitionAttacher)
 {
     this.dataContext                        = dataContext;
     this.eventTracker                       = eventTracker;
     this.boardGameGeekApiClient             = boardGameGeekApiClient;
     this.boardGameGeekGameDefinitionCreator = boardGameGeekGameDefinitionAttacher;
 }
コード例 #3
0
 public BoardGameGeekGamesImporter(IUserRetriever userRetriever, IBoardGameGeekApiClient boardGameGeekApiClient, IGameDefinitionRetriever gameDefinitionRetriever, IGameDefinitionSaver gameDefinitionSaver)
 {
     _userRetriever           = userRetriever;
     _boardGameGeekApiClient  = boardGameGeekApiClient;
     _gameDefinitionRetriever = gameDefinitionRetriever;
     _gameDefinitionSaver     = gameDefinitionSaver;
 }
コード例 #4
0
 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;
 }
コード例 #5
0
 public BoardGameGeekGamesImporter(
     IUserRetriever userRetriever,
     IBoardGameGeekApiClient boardGameGeekApiClient,
     IGameDefinitionRetriever gameDefinitionRetriever,
     ICreateGameDefinitionComponent createGameDefinitionComponent)
 {
     _userRetriever                 = userRetriever;
     _boardGameGeekApiClient        = boardGameGeekApiClient;
     _gameDefinitionRetriever       = gameDefinitionRetriever;
     _createGameDefinitionComponent = createGameDefinitionComponent;
 }
コード例 #6
0
 public GameDefinitionController(IDataContext dataContext,
                                 IGameDefinitionRetriever gameDefinitionRetriever,
                                 IGameDefinitionDetailsViewModelBuilder gameDefinitionTransformation,
                                 IShowingXResultsMessageBuilder showingXResultsMessageBuilder,
                                 IGameDefinitionSaver gameDefinitionCreator,
                                 IBoardGameGeekApiClient boardGameGeekApiClient)
 {
     this.dataContext                   = dataContext;
     this.gameDefinitionRetriever       = gameDefinitionRetriever;
     this.gameDefinitionTransformation  = gameDefinitionTransformation;
     this.showingXResultsMessageBuilder = showingXResultsMessageBuilder;
     this.gameDefinitionSaver           = gameDefinitionCreator;
     _boardGameGeekApiClient            = boardGameGeekApiClient;
 }
コード例 #7
0
        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    = "*****@*****.**"
            };
        }
コード例 #8
0
 public GameDefinitionController(IGameDefinitionRetriever gameDefinitionRetriever,
     ITrendingGamesRetriever trendingGamesRetriever,
     IGameDefinitionDetailsViewModelBuilder gameDefinitionTransformation,
     IGameDefinitionSaver gameDefinitionCreator,
     IBoardGameGeekApiClient boardGameGeekApiClient,
     IUserRetriever userRetriever,
     IBoardGameGeekGamesImporter boardGameGeekGamesImporter,
     ITransformer transformer)
 {
     _gameDefinitionRetriever = gameDefinitionRetriever;
     _trendingGamesRetriever = trendingGamesRetriever;
     _gameDefinitionTransformation = gameDefinitionTransformation;
     _gameDefinitionSaver = gameDefinitionCreator;
     _boardGameGeekApiClient = boardGameGeekApiClient;
     _userRetriever = userRetriever;
     _boardGameGeekGamesImporter = boardGameGeekGamesImporter;
     _transformer = transformer;
 }
コード例 #9
0
 public GameDefinitionController(IGameDefinitionRetriever gameDefinitionRetriever,
                                 ITrendingGamesRetriever trendingGamesRetriever,
                                 IGameDefinitionDetailsViewModelBuilder gameDefinitionTransformation,
                                 IGameDefinitionSaver gameDefinitionCreator,
                                 IBoardGameGeekApiClient boardGameGeekApiClient,
                                 IUserRetriever userRetriever,
                                 IBoardGameGeekGamesImporter boardGameGeekGamesImporter,
                                 ITransformer transformer)
 {
     _gameDefinitionRetriever      = gameDefinitionRetriever;
     _trendingGamesRetriever       = trendingGamesRetriever;
     _gameDefinitionTransformation = gameDefinitionTransformation;
     _gameDefinitionSaver          = gameDefinitionCreator;
     _boardGameGeekApiClient       = boardGameGeekApiClient;
     _userRetriever = userRetriever;
     _boardGameGeekGamesImporter = boardGameGeekGamesImporter;
     _transformer = transformer;
 }
コード例 #10
0
        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 = "*****@*****.**"
            };
        }
コード例 #11
0
        public virtual void SetUp()
        {
            AutomapperConfiguration.Configure();
            dataContextMock                   = MockRepository.GenerateMock <NemeStatsDataContext>();
            gameDefinitionRetrieverMock       = MockRepository.GenerateMock <IGameDefinitionRetriever>();
            gameDefinitionTransformationMock  = MockRepository.GenerateMock <IGameDefinitionDetailsViewModelBuilder>();
            showingXResultsMessageBuilderMock = MockRepository.GenerateMock <IShowingXResultsMessageBuilder>();
            gameDefinitionCreatorMock         = MockRepository.GenerateMock <IGameDefinitionSaver>();
            urlHelperMock          = MockRepository.GenerateMock <UrlHelper>();
            boardGameGeekApiClient = MockRepository.GenerateMock <IBoardGameGeekApiClient>();
            gameDefinitionControllerPartialMock = MockRepository.GeneratePartialMock <GameDefinitionController>(
                dataContextMock,
                gameDefinitionRetrieverMock,
                gameDefinitionTransformationMock,
                showingXResultsMessageBuilderMock,
                gameDefinitionCreatorMock,
                boardGameGeekApiClient);
            gameDefinitionControllerPartialMock.Url = urlHelperMock;

            asyncRequestMock = MockRepository.GenerateMock <HttpRequestBase>();
            asyncRequestMock.Expect(x => x.Headers)
            .Repeat.Any()
            .Return(new System.Net.WebHeaderCollection
            {
                { "X-Requested-With", "XMLHttpRequest" }
            });

            var context = MockRepository.GenerateMock <HttpContextBase>();

            context.Expect(x => x.Request)
            .Repeat.Any()
            .Return(asyncRequestMock);

            gameDefinitionControllerPartialMock.ControllerContext = new ControllerContext(context, new RouteData(), gameDefinitionControllerPartialMock);

            currentUser = new ApplicationUser()
            {
                Id = "user id",
                CurrentGamingGroupId = 15151
            };
        }
コード例 #12
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;
 }
コード例 #13
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;
 }
コード例 #14
0
 public BoardGameGeekGameDefinitionCreator(IDataContext dataContext, IBoardGameGeekApiClient boardGameGeekApiClient)
 {
     _dataContext = dataContext;
     _boardGameGeekApiClient = boardGameGeekApiClient;
 }
コード例 #15
0
 public BoardGameGeekBatchUpdateJobService(IDataContext dataContext, IBoardGameGeekApiClient boardGameGeekApiClient, IRollbarClient rollbar) : base(rollbar)
 {
     _dataContext = dataContext;
     _boardGameGeekApiClient = boardGameGeekApiClient;
 }
コード例 #16
0
 public virtual void FixtureSetUp()
 {
     ApiClient = new BoardGameGeekClient(new ApiDownloaderService(), new RollbarClient());
 }
コード例 #17
0
 public BoardGameGeekProvider(IBoardGameGeekApiClient apiClient, IBoardGameGeekApiClientConfiguration configuration)
 {
     _apiClient     = apiClient;
     _configuration = configuration;
 }
コード例 #18
0
 public BoardGameGeekBatchUpdateJobService(IDataContext dataContext, IBoardGameGeekApiClient boardGameGeekApiClient, IRollbarClient rollbar) : base(rollbar)
 {
     _dataContext            = dataContext;
     _boardGameGeekApiClient = boardGameGeekApiClient;
 }
コード例 #19
0
 public virtual void FixtureSetUp()
 {
     ApiClient = new BoardGameGeekClient(new ApiDownloaderService());
 }
コード例 #20
0
 public BoardGameGeekGameDefinitionCreator(IDataContext dataContext, IBoardGameGeekApiClient boardGameGeekApiClient)
 {
     _dataContext            = dataContext;
     _boardGameGeekApiClient = boardGameGeekApiClient;
 }