Skip to content

Commit 371409e

Browse files
committed
Docs draft
1 parent f37b56f commit 371409e

File tree

3 files changed

+718
-5
lines changed

3 files changed

+718
-5
lines changed

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
# AngleSharp.Diffing
2-
This library makes it possible to compare a AngleSharp _control_ `INodeList` and a _test_ `INodeList` and get a list of differences between them.
2+
This library makes it possible to compare a AngleSharp _control_ `INodeList` and a _test_ `INodeList` and get a list of `IDiff` differences between them.
33

4-
The _control_ nodes represents the expected, i.e. how the nodes are expected to look, and the _test_ nodes represents the other nodes
5-
that should be compared to the _control_ nodes.
4+
The _control_ nodes represents the expected, i.e. how the nodes are expected to look, and the _test_ nodes represents the other nodes that should be compared to the _control_ nodes.
65

76
## Usage
87

98
## Difference engine steps
10-
The heart of the library is the `HtmlDifferenceEngine`, which goes through the following steps to determine if the
11-
control `INodeList` is the same as the test `INodeList`.
9+
The heart of the library is the `HtmlDifferenceEngine` class, which goes through the steps illustrated in the activity diagram below to determine if the control nodes is the same as the test nodes.
10+
11+
The `HtmlDifferenceEngine` class depends on three _strategies_, the `IFilterStrategy`, `IMatcherStrategy`, and `ICompareStrategy` types. These are used in the highlighted activities in the diagram. With those, we can control what nodes and attributes take part in the comparison (filter strategy), how control and test nodes and attributes are matched up for comparison (matching strategy), and finally, how nodes and attributes are determined to be same or different (compare strategy).
12+
13+
It starts with a call to the `Compare(INodeList controlNodes, INodeList testNodes)` and recursively calls itself when nodes have child nodes.
14+
15+
![img](docs/HtmlDifferenceEngineFlow.svg)
16+

0 commit comments

Comments
 (0)