-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathIntegrationTests.cs
More file actions
55 lines (49 loc) · 1.35 KB
/
IntegrationTests.cs
File metadata and controls
55 lines (49 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xunit;
namespace Markdig.SyntaxHighlighting.Tests
{
public class IntegrationTests
{
[Fact]
public void ShouldUseDefaultRendererIfLanguageIsNotIndicated() {
string testString = @"
# This is a test
```
{
""jsonProperty"": 1
}
```";
var pipeline = new MarkdownPipelineBuilder()
.UseAdvancedExtensions()
.UseSyntaxHighlighting()
.Build();
var html = Markdown.ToHtml(testString, pipeline);
Assert.True(html.Contains("<pre><code>"));
Assert.True(html.Contains("jsonProperty"));
Assert.False(html.Contains("lang-"));
}
[Fact]
public void ShouldColorizeSyntaxWhenLanguageIsIndicated()
{
string testString = @"
# This is a test
```json
{
""jsonProperty"": 1
}
```";
var pipeline = new MarkdownPipelineBuilder()
.UseAdvancedExtensions()
.UseSyntaxHighlighting()
.Build();
var html = Markdown.ToHtml(testString, pipeline);
Assert.True(html.Contains("<div"));
Assert.True(html.Contains("jsonProperty"));
Assert.True(html.Contains("lang-"));
}
}
}