public override bool Execute() { if(Input==null) { return true; } template = LoadTemplate(); if (template == null) { return false; } output = new List<ITaskItem>(); var success = Enumerable .Range(0, Input.Length) .All(ExecuteItem); if(success) { Output = output.ToArray(); } return success; }
public void ShouldReplaceMarkerInSourceWithParameter() { var templ = new Template("This is {name} a template"); Assert.Equal("This is really a template", templ.Execute(new Dictionary<string, string> { { "name", "really" } })); }
public void ShouldReplaceIndexedMarkerInSourceWithMatchingIndexedParameter() { var templ = new Template("This is {left} a {right}"); Assert.Equal("This is really a template", templ.Execute(new Dictionary<string,string> {{"left","really"},{"right","template"}})); }