Пример #1
0
        public void Test_EditGame_GameId_Less_Zero()
        {
            //arrange
            GameService servise = new GameService(_unitOfWork.Object, null);
            GameDTO game = new GameDTO()
            {
                GameId = -1,
                Key = "key",
                Description = "Description",
                Name = "Name",
                Genres = genres.Object.GetAll().Take(1).Select(Mapper.Map<Genre, GenreDTO>),
                PlatformTypes = platformTypes.Object.GetAll().Take(1).Select(Mapper.Map<PlatformType, PlatformTypeDTO>),
                Publisher = new PublisherDTO() { CompanyName = "name", PublisherId = 1, Description = "description", HomePage = "home.page" },
                Price = 1,
                Discontinued = false,
                UnitsInStock = 20
            };

            //act
            servise.Edit(game);
        }
Пример #2
0
        public void Test_EditGame_Is_Null()
        {
            //arrange
            GameService servise = new GameService(_unitOfWork.Object, null);

            //act
            servise.Edit(null);
        }
Пример #3
0
        public void Test_EditGame_GameId_Is_Zero()
        {
            //arrange
            GameService servise = new GameService(_unitOfWork.Object, null);
            GameDTO game = new GameDTO()
            {
                GameId = 0,
                Key = "key",
                Description = "Description",
                Name = "Name",
                Genres = genres.Object.GetAll().Take(1).Select(Mapper.Map<Genre, GenreDTO>),
                PlatformTypes = platformTypes.Object.GetAll().Take(1).Select(Mapper.Map<PlatformType, PlatformTypeDTO>)
            };

            //act
            servise.Edit(game);
        }