Esempio n. 1
0
        public void Test_DeleteGame_Game_Is_Null()
        {
            //arrange
            GameService servise = new GameService(_unitOfWork.Object, null);

            //act
            servise.Delete(null);
        }
Esempio n. 2
0
        public void Test_DeleteGame_Call_Delete()
        {
            //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.Delete(game);

            //assert
            games.Verify(g => g.Delete(It.IsAny<Game>()), Times.Once());
        }