예제 #1
0
        public void ChangingFilterMarksRecipeModified()
        {
            XmlDocumentFactory.Type = typeof(XmlDocumentMock);
            CategorySelector selector = new CategorySelector();
            IRecipe          recipe   = RecipeFactory.NewRecipe(string.Empty);

            recipe.RegisterSelector(selector);
            recipe.Save(@"c:\nirvana.recipe");
            Assert.False(recipe.Modified, "Expected recipe not being modified.");
            selector.IncludedCategories.Add("bla");
            Assert.True(recipe.Modified, "Expected recipe being modified.");
        }
        public async Task <int> Save(RecipeModel recipe)
        {
            var recipeEntity = _mapper.Map <Recipe>(recipe);

            return(await _recipeRepository.Save(recipeEntity));
        }