示例#1
0
		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;
		}
示例#2
0
		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" } }));
		}
示例#3
0
		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"}}));
		}