예제 #1
0
 public PlayerController(
     IGameResultViewModelBuilder builder,
     IPlayerDetailsViewModelBuilder playerDetailsViewModelBuilder,
     IShowingXResultsMessageBuilder showingXResultsMessageBuilder,
     IPlayerSaver playerSaver,
     IPlayerRetriever playerRetriever,
     IPlayerInviter playerInviter,
     IPlayerEditViewModelBuilder playerEditViewModelBuilder,
     IPlayerSummaryBuilder playerSummaryBuilder,
     ITopPlayerViewModelBuilder topPlayerViewModelBuilder,
     INemesisHistoryRetriever nemesisHistoryRetriever,
     INemesisChangeViewModelBuilder nemesisChangeViewModelBuilder,
     IPlayerDeleter playerDeleter)
 {
     this.builder = builder;
     this.playerDetailsViewModelBuilder = playerDetailsViewModelBuilder;
     this.showingXResultsMessageBuilder = showingXResultsMessageBuilder;
     this.playerSaver = playerSaver;
     this.playerRetriever = playerRetriever;
     this.playerInviter = playerInviter;
     this.playerEditViewModelBuilder = playerEditViewModelBuilder;
     this.playerSummaryBuilder = playerSummaryBuilder;
     this.topPlayerViewModelBuilder = topPlayerViewModelBuilder;
     this.nemesisHistoryRetriever = nemesisHistoryRetriever;
     this.nemesisChangeViewModelBuilder = nemesisChangeViewModelBuilder;
     _playerDeleter = playerDeleter;
 }
예제 #2
0
 public PlayerController(
     IGameResultViewModelBuilder builder,
     IPlayerDetailsViewModelBuilder playerDetailsViewModelBuilder,
     IShowingXResultsMessageBuilder showingXResultsMessageBuilder,
     IPlayerSaver playerSaver,
     IPlayerRetriever playerRetriever,
     IPlayerInviter playerInviter,
     IPlayerEditViewModelBuilder playerEditViewModelBuilder,
     IPlayerSummaryBuilder playerSummaryBuilder,
     ITopPlayerViewModelBuilder topPlayerViewModelBuilder,
     INemesisHistoryRetriever nemesisHistoryRetriever,
     INemesisChangeViewModelBuilder nemesisChangeViewModelBuilder,
     IPlayerDeleter playerDeleter)
 {
     this.builder = builder;
     this.playerDetailsViewModelBuilder = playerDetailsViewModelBuilder;
     this.showingXResultsMessageBuilder = showingXResultsMessageBuilder;
     this.playerSaver                   = playerSaver;
     this.playerRetriever               = playerRetriever;
     this.playerInviter                 = playerInviter;
     this.playerEditViewModelBuilder    = playerEditViewModelBuilder;
     this.playerSummaryBuilder          = playerSummaryBuilder;
     this.topPlayerViewModelBuilder     = topPlayerViewModelBuilder;
     this.nemesisHistoryRetriever       = nemesisHistoryRetriever;
     this.nemesisChangeViewModelBuilder = nemesisChangeViewModelBuilder;
     _playerDeleter = playerDeleter;
 }
예제 #3
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;
 }
예제 #4
0
 public PlayedGameController(
     NemeStatsDataContext dataContext,
     IPlayedGameRetriever playedGameRetriever,
     IPlayerRetriever playerRetriever,
     IPlayedGameDetailsViewModelBuilder builder,
     IGameDefinitionRetriever gameDefinitionRetriever,
     IShowingXResultsMessageBuilder showingXResultsMessageBuilder,
     IPlayedGameCreator playedGameCreator,
     IPlayedGameDeleter playedGameDeleter)
 {
     this.dataContext                   = dataContext;
     this.playedGameRetriever           = playedGameRetriever;
     this.playerRetriever               = playerRetriever;
     this.playedGameDetailsBuilder      = builder;
     this.gameDefinitionRetriever       = gameDefinitionRetriever;
     this.showingXResultsMessageBuilder = showingXResultsMessageBuilder;
     this.playedGameCreator             = playedGameCreator;
     this.playedGameDeleter             = playedGameDeleter;
 }
예제 #5
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
            };
        }
예제 #6
0
 public GamingGroupController(
     IGamingGroupViewModelBuilder gamingGroupViewModelBuilder,
     IGamingGroupAccessGranter gamingGroupAccessGranter,
     IGamingGroupSaver gamingGroupSaver,
     IGamingGroupRetriever gamingGroupRetriever,
     IShowingXResultsMessageBuilder showingXResultsMessageBuilder,
     IPlayerWithNemesisViewModelBuilder playerWithNemesisViewModelBuilder,
     IPlayedGameDetailsViewModelBuilder playedGameDetailsViewModelBuilder,
     IGameDefinitionSummaryViewModelBuilder gameDefinitionSummaryViewModelBuilder,
     IGamingGroupContextSwitcher gamingGroupContextSwitcher)
 {
     this.gamingGroupViewModelBuilder           = gamingGroupViewModelBuilder;
     this.gamingGroupAccessGranter              = gamingGroupAccessGranter;
     this.gamingGroupSaver                      = gamingGroupSaver;
     this.gamingGroupRetriever                  = gamingGroupRetriever;
     this.showingXResultsMessageBuilder         = showingXResultsMessageBuilder;
     this.playerWithNemesisViewModelBuilder     = playerWithNemesisViewModelBuilder;
     this.playedGameDetailsViewModelBuilder     = playedGameDetailsViewModelBuilder;
     this.gameDefinitionSummaryViewModelBuilder = gameDefinitionSummaryViewModelBuilder;
     this.gamingGroupContextSwitcher            = gamingGroupContextSwitcher;
 }
예제 #7
0
 public void SetUp()
 {
     messageBuilder = new ShowingXResultsMessageBuilder();
 }
예제 #8
0
 public void SetUp()
 {
     messageBuilder = new ShowingXResultsMessageBuilder();
 }