Пример #1
0
        public void CorrectParsingImageInSimpleLine(string text, string link, string alt, int leftBound)
        {
            var parser = new TextParser(imgTag, new List <IParser>()
            {
                new ImageTagParser(imgTag)
            });
            var result     = parser.ParseLine(text);
            var attributes = new List <TagAttribute>()
            {
                new TagAttribute(link, "src"), new TagAttribute(alt, "alt")
            };
            var imageTag = new ImageTag()
            {
                Tag         = "img",
                MarkdownTag = getMarkdowFromText.Match(text).Value,
                Attributes  = attributes
            };
            var expected = new List <Token>()
            {
                new Token(leftBound, imageTag)
            };

            result.Should().BeEquivalentTo(expected);
        }