private void Help(string template, string text, string expected) { var line = new Line(); line.Text = text; line.Items = line.Text.Split('\t').ToList(); var actual = TransformEngine.Transform(template, line, null); Assert.AreEqual(expected, actual); }
public void Test2() { var template = "this is {item0} and {item1}."; var line = new Line(); line.Text = "tom\tjack"; line.Items = line.Text.Split('\t').ToList(); var expected = "this is tom and jack."; var actual = TransformEngine.Transform(template, line, null); Assert.AreEqual(expected, actual); }
public void Test3() { var template = "{name} is {age} years old."; var line = new Line(); line.Text = "tom\t13"; line.Items = line.Text.Split('\t').ToList(); var titles = new List <string> { "name", "age" }; var expected = "tom is 13 years old."; var actual = TransformEngine.Transform(template, line, titles); Assert.AreEqual(expected, actual); }
private IEnumerable <IPipeResult> PumpAll() { var engine = new TransformEngine(_pack); return(_pack.Sources.Select(source => engine.Transform(source)).ToList()); }