mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-04 05:44:50 +00:00
Add SmartyPants tests
This commit is contained in:
36
src/Markdig.Tests/TestSmartyPants.cs
Normal file
36
src/Markdig.Tests/TestSmartyPants.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using Markdig.Extensions.SmartyPants;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Markdig.Tests
|
||||
{
|
||||
public class TestSmartyPants
|
||||
{
|
||||
[Test]
|
||||
public void MappingCanBeReconfigured()
|
||||
{
|
||||
SmartyPantOptions options = new SmartyPantOptions();
|
||||
options.Mapping[SmartyPantType.LeftAngleQuote] = "foo";
|
||||
options.Mapping[SmartyPantType.RightAngleQuote] = "bar";
|
||||
|
||||
var pipeline = new MarkdownPipelineBuilder()
|
||||
.UseSmartyPants(options)
|
||||
.Build();
|
||||
|
||||
TestParser.TestSpec("<<test>>", "<p>footestbar</p>", pipeline);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MappingCanBeReconfigured_HandlesRemovedMappings()
|
||||
{
|
||||
SmartyPantOptions options = new SmartyPantOptions();
|
||||
options.Mapping.Remove(SmartyPantType.LeftAngleQuote);
|
||||
options.Mapping.Remove(SmartyPantType.RightAngleQuote);
|
||||
|
||||
var pipeline = new MarkdownPipelineBuilder()
|
||||
.UseSmartyPants(options)
|
||||
.Build();
|
||||
|
||||
TestParser.TestSpec("<<test>>", "<p>«test»</p>", pipeline);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user