public void Render_WithTemplateForNullable_ReturnsValueIs5()
        {
            var message = new ComplexModel(){ NullIntProp = 5 };
            var template = new Template<ComplexModel>("Value is {{NullIntProp}}");
            var content = new TemplateRenderer<ComplexModel>(template);
            var text = content.Render(message);

            Assert.Equal("Value is 5", text);
        }
        public void Render_TemplateWithForeach_RenderIEnumerableOfString()
        {
            var message = new ComplexModel
            {
                BunchOfStrings = new List<string>() { "ONE", "TWO"}
            };

            string templateText = @"<<foreach:BunchOfStrings>>{{value}} <</foreach:BunchOfStrings>>";
            var template = new Template<ComplexModel>(templateText);
            var content = new TemplateRenderer<ComplexModel>(template);
            var text = content.Render(message);

            Assert.Contains("ONE", text);
            Assert.Contains("TWO", text);
        }
        public void Render_TemplateWithIEnumerable_RenderIEnumerableOfString()
        {
            var message = new ComplexModel
            {
                BunchOfStrings = new List<string>() { "ONE", "TWO"}
            };

            var template = new Template<ComplexModel>("{{BunchOfStrings}}");
            var content = new TemplateRenderer<ComplexModel>(template);
            var text = content.Render(message);

            Assert.Contains("ONE, TWO", text);
        }
        public void Render_TemplateWithForeach_RenderIEnumerableOfAddresses()
        {
            //for this potentially can extract whole section and then render it and re-insert
            var message = new ComplexModel
            {
                SomeText = "Bob",
                BunchOfAddresses = new List<Address>() {
                new Address{ StreetNumber = 5, StreetName = "Main"},
                new Address{ StreetNumber = 10, StreetName = "Main"}
                }
            };

            string templateText = @"{{SomeText}} <<foreach:BunchOfAddresses>>{{StreetNumber}} {{StreetName}} <</foreach:BunchOfAddresses>>";
            var template = new Template<ComplexModel>(templateText);
            var content = new TemplateRenderer<ComplexModel>(template);
            var text = content.Render(message);

            Assert.Contains("5 Main", text);
            Assert.Contains("10 Main", text);
            Assert.Contains("Bob", text);
        }