-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathHtmlBodyTests.cs
More file actions
50 lines (42 loc) · 1.41 KB
/
HtmlBodyTests.cs
File metadata and controls
50 lines (42 loc) · 1.41 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
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Threading.Tasks;
using Waher.Runtime.IO;
namespace Waher.Content.Html.Test
{
[TestClass]
public class HtmlBodyTests
{
[TestMethod]
public async Task Test_01_Simple_Body()
{
string Html = await Files.ReadAllTextAsync("Data\\Simple.html");
string Body = HtmlDocument.GetBody(Html);
string ExpectedBody = await Files.ReadAllTextAsync("Data\\SimpleBody.txt");
Assert.AreEqual(ExpectedBody, Body);
}
[TestMethod]
public async Task Test_02_SimpleWithAttributes_Body()
{
string Html = await Files.ReadAllTextAsync("Data\\SimpleWithAttributes.html");
string Body = HtmlDocument.GetBody(Html);
string ExpectedBody = await Files.ReadAllTextAsync("Data\\SimpleBody.txt");
Assert.AreEqual(ExpectedBody, Body);
}
[TestMethod]
public async Task Test_03_Simple_Head()
{
string Html = await Files.ReadAllTextAsync("Data\\Simple.html");
string Head = HtmlDocument.GetHead(Html);
string ExpectedHead = await Files.ReadAllTextAsync("Data\\SimpleHead.txt");
Assert.AreEqual(ExpectedHead, Head);
}
[TestMethod]
public async Task Test_04_SimpleWithAttributes_Head()
{
string Html = await Files.ReadAllTextAsync("Data\\SimpleWithAttributes.html");
string Head = HtmlDocument.GetHead(Html);
string ExpectedHead = await Files.ReadAllTextAsync("Data\\SimpleHead.txt");
Assert.AreEqual(ExpectedHead, Head);
}
}
}