Exemple #1
0
        public void GameList_ReturnGameListWhenQuanityMoreThanPageSize_RightReturn()
        {
            //Arrange
            ShowService service =
                new ShowService(
                    uow.Object,
                    CPUs.Object,
                    GPUs.Object,
                    Games.Object,
                    Mapper);
            var gameList = new List <Game>();

            for (var i = 0; i < 100; i++)
            {
                gameList.Add(
                    new Game
                {
                    GameGuid = Guid.NewGuid(),
                    Name     = i.ToString()
                });
            }

            Games.Setup(x => x.Get()).Returns(gameList.AsQueryable());
            //Act
            var result = service.ListGame(2);

            //Assert
            Assert.AreEqual(10, result.GameList.Count());
        }
Exemple #2
0
        public void GameList_ReturnGameListWithPagingInfo_ReturnRightCountOfList()
        {
            //Arrange
            ShowService service =
                new ShowService(
                    uow.Object,
                    CPUs.Object,
                    GPUs.Object,
                    Games.Object,
                    Mapper);
            var gameList = new List <Game>();

            for (var i = 0; i < 16; i++)
            {
                gameList.Add(
                    new Game {
                    GameGuid = Guid.NewGuid(), Name = i.ToString()
                });
            }

            Games.Setup(x => x.Get()).Returns(gameList.AsQueryable());
            //Act
            var result = service.ListGame(2);

            //Assert
            Assert.AreEqual(6, result.GameList.Count());
        }