-
-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathDomTests.cs
More file actions
30 lines (27 loc) · 955 Bytes
/
DomTests.cs
File metadata and controls
30 lines (27 loc) · 955 Bytes
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
namespace AngleSharp.Js.Tests
{
using NUnit.Framework;
using System.Threading.Tasks;
[TestFixture]
public class DomTests
{
[Test]
public async Task NodeHasChildNodesIsAFunction()
{
var result = await "document.createElement('div').hasChildNodes".EvalScriptAsync();
Assert.AreEqual("function hasChildNodes() { [native code] }", result);
}
[Test]
public async Task NodeHasChildNodesWithoutChildren()
{
var result = await "document.createElement('div').hasChildNodes()".EvalScriptAsync();
Assert.AreEqual("False", result);
}
[Test]
public async Task NodeHasChildNodesWithChildren()
{
var result = await "new DOMParser().parseFromString(`<div><input/></div>`, 'text/html').body.firstChild.hasChildNodes()".EvalScriptAsync();
Assert.AreEqual("True", result);
}
}
}