Пример #1
0
        public void Delete_FromSeeded_DoesNotThrow()
        {
            //Arrange
            var detailModel = RecipeMapper.MapToDetailModel(CookBookSeedingDbContext.RecipeEntity);

            //Act & Assert
            RepositorySUT.Delete(detailModel);
        }
Пример #2
0
        public void Delete_FromSeeded_DoesNotThrow()
        {
            //Arrange
            var detailModel = RecipeMapper.MapToDetailModel(DAL.Seeds.Seeds.RecipeEntity);

            //Act & Assert
            RepositorySUT.Delete(detailModel);
        }
Пример #3
0
        public void Update_FromSeeded_DoesNotThrow()
        {
            //Arrange
            var detailModel = RecipeMapper.MapToDetailModel(CookBookSeedingDbContext.RecipeEntity);

            detailModel.Name = "Changed recipe name";

            //Act & Assert
            RepositorySUT.InsertOrUpdate(detailModel);
        }
Пример #4
0
        public void GetById_FromSeeded_DoesNotThrowAndEqualsSeeded()
        {
            //Arrange
            var detailModel = RecipeMapper.MapToDetailModel(CookBookSeedingDbContext.RecipeEntity);

            //Act
            var returnedModel = RepositorySUT.GetById(detailModel.Id);

            //Assert
            Assert.Equal(detailModel, returnedModel, RecipeDetailModel.RecipeDetailModelComparer);
        }
Пример #5
0
        public void Update_RemoveIngredients_FromSeeded_CheckUpdated()
        {
            //Arrange
            var detailModel = RecipeMapper.MapToDetailModel(CookBookSeedingDbContext.RecipeEntity);

            detailModel.Ingredients.Clear();

            //Act
            RepositorySUT.InsertOrUpdate(detailModel);

            //Assert
            var returnedModel = RepositorySUT.GetById(detailModel.Id);

            Assert.Equal(detailModel, returnedModel, RecipeDetailModel.RecipeDetailModelComparer);
        }
Пример #6
0
        public void Update_Name_FromSeeded_CheckUpdated()
        {
            //Arrange
            var detailModel = RecipeMapper.MapToDetailModel(CookBookSeedingDbContext.RecipeEntity);

            detailModel.Name = "Changed recipe name 1";

            //Act
            RepositorySUT.InsertOrUpdate(detailModel);

            //Assert
            var returnedModel = RepositorySUT.GetById(detailModel.Id);

            Assert.Equal(detailModel, returnedModel, RecipeDetailModel.RecipeDetailModelComparer);
        }