예제 #1
0
        public void ToString_returns_the_expected_value()
        {
            var text = "Text without special characters";
            var span = new MdTextSpan(text);

            Assert.Equal(text, span.ToString());
        }
예제 #2
0
        public void MdHeading_can_be_initialized_with_span_content()
        {
            var text = new MdTextSpan("Content");

            var heading = new MdHeading(text, 1);

            Assert.Same(text, heading.Text.Content);
        }
예제 #3
0
        public void Text_property_is_converted_to_CompositeSpan_when_required_01()
        {
            var paragraph = new MdParagraph("Text");

            var expected = new MdTextSpan("Text");

            Assert.True(expected.DeepEquals(paragraph.Text));
        }
예제 #4
0
        public void DeepEquals_returns_expected_value()
        {
            var instance1 = new MdTextSpan("content");
            var instance2 = new MdTextSpan("content");
            var instance3 = new MdTextSpan("other content");

            Assert.True(instance1.DeepEquals(instance1));
            Assert.True(instance1.DeepEquals(instance2));

            Assert.False(instance1.DeepEquals(null));
            Assert.False(instance1.DeepEquals(instance3));
            Assert.False(instance1.DeepEquals(new MdCodeSpan("")));
        }
예제 #5
0
        public void String_can_be_implicitly_converted_to_MdTextSpan(string str)
        {
            MdTextSpan span = str;

            if (str == null)
            {
                Assert.Null(span);
            }
            else
            {
                Assert.Equal(str, span.Text);
            }
        }