Beispiel #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());
            }
        }
Beispiel #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());
            }
        }
Beispiel #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();
            }
        }
Beispiel #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();
            }
        }
Beispiel #5
0
        public AnyContentElement AddContent(object value)
        {
            var newContent = new SimpleBlock().Value(value);

            if (content == null)
            {
                content = newContent;
            }
            else
            {
                content.Append(newContent);
            }
            return(this);
        }
Beispiel #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());
            }
        }
Beispiel #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());
            }
        }