Example #1
0
        public void Test_scoped_property_substitute()
        {
            TemplateEngineImpl engine = this.CreateEngine();
            var dataSource            = new {
                Contact = new {
                    FirstName    = "John",
                    LastName     = "Smith",
                    Organisation = new {
                        Name = "Acme Ltd",
                        City = "Auckland"
                    }
                }
            };
            string output = engine.Apply(@"[with Contact]Hello [FirstName] from [with Organisation][Name] in [City][/with][/with]", dataSource);

            Assert.AreEqual("Hello John from Acme Ltd in Auckland", output);
        }