Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        private IEnumerable <IPipeResult> PumpAll()
        {
            var engine = new TransformEngine(_pack);

            return(_pack.Sources.Select(source => engine.Transform(source)).ToList());
        }