private static void SetUpCategorySelector(string optionName, CmdLineHandler clh, IRecipe recipe) { if (clh.HasOption(optionName)) { var selector = new CategorySelector(); selector.IncludedCategories.Add(clh.GetOptionValueFor(optionName)); recipe.RegisterSelector(selector); } }
private static void SetUpRegexSelector(CmdLineHandler clh, IRecipe recipe) { if (clh.HasOption("pattern")) { var selector = new RegexSelector { Pattern = clh.GetOptionValueFor("pattern") }; recipe.RegisterSelector(selector); } }
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."); }
private static void SetUpRegexSelector(CmdLineHandler clh, IRecipe recipe) { if(clh.HasOption("pattern")) { var selector = new RegexSelector { Pattern = clh.GetOptionValueFor( "pattern" ) }; recipe.RegisterSelector(selector); } }
private static void SetUpCategorySelector(string optionName, CmdLineHandler clh, IRecipe recipe) { if(clh.HasOption(optionName)) { var selector = new CategorySelector(); selector.IncludedCategories.Add(clh.GetOptionValueFor(optionName)); recipe.RegisterSelector(selector); } }