Exemplo n.º 1
0
        public void Test_Content_StringWithoutEncoding()
        {
            var sample = "<h1>Hello!</h1>";

            var sc = new SimpleBlock().Value(sample, true);

            using (var sw = new StringWriter())
            {
                sc.WriteTo(sw, contextMock.Object);
                Assert.Equal(sample, sw.ToString());
            }
        }
Exemplo n.º 2
0
        public void Test_Content_StringWithoutEncoding()
        {
            var sample = "<h1>Hello!</h1>";

            var sc = new SimpleBlock().Value(sample, true);

            using (var sw = new StringWriter())
            {
                sc.WriteTo(sw, contextMock.Object);
                Assert.Equal(sample, sw.ToString());
            }
        }
Exemplo n.º 3
0
        public void Test_Content_Calls_ContextWrite()
        {
            var obj = new object();

            using (var sw = new StringWriter())
            {
                var sc = new SimpleBlock().Value(obj);

                sc.WriteTo(sw, contextMock.Object);

                contextMock.Verify();
            }
        }
Exemplo n.º 4
0
        public void Test_Content_Calls_ContextWrite()
        {
            var obj = new object();

            using (var sw = new StringWriter())
            {
                var sc = new SimpleBlock().Value(obj);

                sc.WriteTo(sw, contextMock.Object);

                contextMock.Verify();
            }
        }
Exemplo n.º 5
0
        public AnyContentElement AddContent(object value)
        {
            var newContent = new SimpleBlock().Value(value);

            if (content == null)
            {
                content = newContent;
            }
            else
            {
                content.Append(newContent);
            }
            return(this);
        }
Exemplo n.º 6
0
        public void Test_ContentKnows_WritableBlock()
        {
            var sample = "<test>";

            var obj = new DummyWritableBlock() { Content = sample };

            using (var sw = new StringWriter())
            {
                var sc = new SimpleBlock().Value(obj);

                sc.WriteTo(sw, contextMock.Object);

                Assert.Equal(sample, sw.ToString());
            }
        }
Exemplo n.º 7
0
        public void Test_ContentKnows_WritableBlock()
        {
            var sample = "<test>";

            var obj = new DummyWritableBlock() { Content = sample };

            using (var sw = new StringWriter())
            {
                var sc = new SimpleBlock().Value(obj);

                sc.WriteTo(sw, contextMock.Object);

                Assert.Equal(sample, sw.ToString());
            }
        }