Example #1
0
        public void SetUp()
        {
            _autoMocker = new RhinoAutoMocker<UniversalGameController>();
            _currentUser = new ApplicationUser();

            _expectedPlayedGame1 = new PlayedGame();
            _expectedPlayedGame2 = new PlayedGame();
            _expectedPlayerWinRecord1 = new PlayerWinRecord();
            _expectedPlayerWinRecord2 = new PlayerWinRecord();
            _expectedGameDefinitionSummary = new GameDefinitionSummary
            {
                Id = 50,
                AveragePlayersPerGame = 2.59M,
                GamingGroupName = "some gaming group name",
                TotalNumberOfGamesPlayed = 3,
                PlayedGames = new List<PlayedGame>
                {
                    _expectedPlayedGame1,
                    _expectedPlayedGame2
                },
                PlayerWinRecords = new List<PlayerWinRecord>
                {
                    _expectedPlayerWinRecord1,
                    _expectedPlayerWinRecord2
                }
            };
            _expectedBoardGameGeekGameSummary = new BoardGameGeekGameSummary
            {
                GamingGroupGameDefinitionSummary = _expectedGameDefinitionSummary
            };
            _expectedUniversalGameDetailsViewModel = new UniversalGameDetailsViewModel
            {
                BoardGameGeekInfo = new BoardGameGeekInfoViewModel()
            };

            _autoMocker.Get<IUniversalGameRetriever>().Expect(mock => mock.GetBoardGameGeekGameSummary(Arg<int>.Is.Anything, Arg<ApplicationUser>.Is.Anything, Arg<int>.Is.Anything))
                .Return(_expectedBoardGameGeekGameSummary);
            _autoMocker.Get<ITransformer>()
                .Expect(mock => mock.Transform<UniversalGameDetailsViewModel>(Arg<BoardGameGeekGameSummary>.Is.Anything))
                .Return(_expectedUniversalGameDetailsViewModel);
        }