public void ShouldParseParagraphWithAttributeReference() { var input = "Whenever distances need to be specified, e.g. for a {ref_current}/query-dsl-geo-distance-query.html[geo distance query], the distance unit can be specified as a double number representing distance in meters, as a new instance of a `Distance`, or as a string of the form number and distance unit e.g. \"`2.72km`\""; var document = Document.Parse(input); AsciiDocAssert.Equal(input, document); }
public void ShouldOutputCorrectResponse() { var text = @"When specifying a `format` **and** `extended_bounds`, in order for Elasticsearch to be able to parse the serialized ``DateTime``s of `extended_bounds` correctly, the `date_optional_time` format is included as part of the `format` value."; var document = Document.Parse(text); AsciiDocAssert.Equal(text, document); }
public void ShouldParseImageWithAnchorAndTitle() { var input = "image::hadouken-indentation.jpg[hadouken indenting]"; var document = Document.Parse(input); Assert.NotNull(document); Assert.True(document.Count == 1); Assert.IsType <Image>(document[0]); var image = (Image)document[0]; Assert.Equal("hadouken-indentation.jpg", image.Path); Assert.Equal("hadouken indenting", image.AlternateText); AsciiDocAssert.Equal(input, document); }
public void ShouldNotParseImplicitLinkInsideMonospace() { var text = "This is a paragraph with a `http://example.com` in"; var document = Document.Parse(text); Assert.NotNull(document); Assert.True(document.Count == 1); Assert.IsType <Paragraph>(document[0]); var paragraph = (Paragraph)document[0]; Assert.True(paragraph.Count == 3); Assert.IsType <Monospace>(paragraph[1]); AsciiDocAssert.Equal(text, document); }
public void ShouldParseLink() { var text = "{ref_current}/certutil.html[`certutil` tool]"; var document = Document.Parse(text); Assert.NotNull(document); Assert.True(document.Count == 1); Assert.IsType <Paragraph>(document[0]); var paragraph = (Paragraph)document[0]; Assert.True(paragraph.Count == 4); Assert.IsType <AttributeReference>(paragraph[0]); Assert.IsType <TextLiteral>(paragraph[1]); Assert.IsType <Monospace>(paragraph[2]); Assert.IsType <TextLiteral>(paragraph[3]); AsciiDocAssert.Equal(text, document); }
public void CanParseFloatingTitleWithAttributes() { var title = $"[[title-anchor]]\r\n[float]\r\n[attribute1,attribute2]\r\n== This is the title"; var document = Document.Parse(title); Assert.NotNull(document); Assert.True(document.Count == 1); Assert.IsType <SectionTitle>(document[0]); var sectionTitle = (SectionTitle)document[0]; Assert.True(sectionTitle.IsFloating); Assert.IsType <TextLiteral>(sectionTitle[0]); var text = (TextLiteral)sectionTitle[0]; Assert.Equal("This is the title", text.Text); AsciiDocAssert.Equal(title, document); }
public void CanParseDiscreteTitle() { var title = $"[discrete]\r\n== This is the title"; var document = Document.Parse(title); Assert.NotNull(document); Assert.True(document.Count == 1); Assert.IsType <SectionTitle>(document[0]); var sectionTitle = (SectionTitle)document[0]; Assert.True(sectionTitle.IsDiscrete); Assert.IsType <TextLiteral>(sectionTitle[0]); var text = (TextLiteral)sectionTitle[0]; Assert.Equal("This is the title", text.Text); AsciiDocAssert.Equal(title, document); }
public void ShouldParseImplicitAnchor(string protocol, string asciidoc, string linkText, int count, int index) { var document = Document.Parse(asciidoc); Assert.NotNull(document); Assert.True(document.Count == 1); Assert.IsType <Paragraph>(document[0]); var paragraph = (Paragraph)document[0]; Assert.True(paragraph.Count == count); Assert.IsType <Link>(paragraph[index]); var link = (Link)paragraph[index]; Assert.Equal($"{protocol}://example.com", link.Href); Assert.Equal(linkText, link.Text); AsciiDocAssert.Equal(asciidoc, document); }
public void ShouldParseWithFloat() { var text = @"[[captain-quote]] [quote, Captain James T. Kirk, Star Trek IV: The Voyage Home] .After landing the cloaked Klingon bird of prey in Golden Gate park: Everybody remember where we parked."; var document = Document.Parse(text); Assert.NotNull(document); Assert.True(document.Count == 1); Assert.IsType <Quote>(document[0]); var quote = (Quote)document[0]; Assert.True(quote.Count == 1); Assert.IsType <Paragraph>(quote[0]); Assert.True(quote.Attributes.Count == 3); Assert.Equal("After landing the cloaked Klingon bird of prey in Golden Gate park:", quote.Attributes.Title.Text); AsciiDocAssert.Equal(text, document); }
public void OutputShouldMatchInput(string input) { var document = Document.Parse(input); AsciiDocAssert.Equal(input, document); }