Esempio n. 1
0
        public void It_supports_accessing_members_of_child_objects()
        {
            var a       = new VariableReference("a.b");
            var writer  = new StringWriter();
            var context = new RenderContext(null, new { a = new { b = "c" } }, writer, null);

            a.Render(context);

            Assert.AreEqual("c", writer.GetStringBuilder().ToString());
        }
Esempio n. 2
0
        public void It_renders_the_named_value_from_the_context()
        {
            var a       = new VariableReference("a");
            var writer  = new StringWriter();
            var context = new RenderContext(null, new { a = "b" }, writer, null);

            a.Render(context);

            Assert.AreEqual("b", writer.GetStringBuilder().ToString());
        }
        public void It_checks_for_keys_containing_dots_before_splitting()
        {
            var a = new VariableReference("a.b");
            var writer = new StringWriter();
            var context = new RenderContext(null, new Dictionary<string, string> { { "a.b", "c" } }, writer, null);

            a.Render(context);

            Assert.AreEqual("c", writer.GetStringBuilder().ToString());
        }
        public void It_supports_accessing_members_of_child_objects()
        {
            var a = new VariableReference("a.b");
            var writer = new StringWriter();
            var context = new RenderContext(null, new { a = new { b = "c" } }, writer, null);

            a.Render(context);

            Assert.AreEqual("c", writer.GetStringBuilder().ToString());
        }
        public void It_renders_the_named_value_from_the_context()
        {
            var a = new VariableReference("a");
            var writer = new StringWriter();
            var context = new RenderContext(null, new { a = "b" }, writer, null);

            a.Render(context);

            Assert.AreEqual("b", writer.GetStringBuilder().ToString());
        }
        public void It_checks_for_keys_containing_dots_before_splitting()
        {
            var a       = new VariableReference("a.b");
            var writer  = new StringWriter();
            var context = new RenderContext(null, new Dictionary <string, string> {
                { "a.b", "c" }
            }, writer, null);

            a.Render(context);

            Assert.AreEqual("c", writer.GetStringBuilder().ToString());
        }